Subject Re: [IBO] TIB_Column.GetAsVariant inconsistent return value if Null
Author mmenaz
I think that an old locate "bug" I reported you by the times of IBO 3.6D, and still exists, is related to this fact.
I reported something like:
------
"I've some problems with IB_Query lookup method when the returning field of a
found record has the null value.
In fact, the resulting variant is not null, instead is not assigned! So I can't
distinguish from a not found row and a found row but with a null field
WorkV := Lookup('CONTATTO_ID, IN_USO', VarArrayOf([MyCustId, 'S']), 'ADDRESS');
If ADDRESS is NOT null the result is correct:

If found: VarIsNull is False, VarType(WorkV)=varEmpty is False
If NOT found: VarIsNull is False, VarType(WorkV)=varEmpty is True

If ADDRESS *IS* null the result is wrong:

If found: VarIsNull is False, VarType(WorkV)=varEmpty is True (should be TRUE,
FALSE)
If NOT found: VarIsNull is False, VarType(WorkV)=varEmpty is True
------
I think that the null issue should be fixed, but depends also upon the impact
it has in the IBO, well tested and working code...
Thanks
Marco Menardi

--- In IBObjects@y..., "Jason Wharton" <jwharton@i...> wrote:
> I'm really not 100% certain what to do about this issue. NULL's have been a
> pain in the rump for some time now.
> How about all of you talk this over and come to a consensus.
>
> Jason Wharton
> CPS - Mesa AZ
> http://www.ibobjects.com
>
>
> ----- Original Message -----
> From: "mmenaz" <mmenaz@l...>
> To: <IBObjects@y...>
> Sent: Saturday, March 09, 2002 10:35 AM
> Subject: [IBO] TIB_Column.GetAsVariant inconsistent return value if Null
>
>
> > Patching FastReport IBO part, I've discovered something seems a bad
> behaviour of IBO, since the code behaves differently from the
> > couterpart VCL (and also differs from logic!)
> >
> > If I've a field that is NULL (SQL null, I mean), reading it AsVariant
> returns a Unassigned variant instead of a varNull.
[cut]