Subject IB_Query.Lookup BUG with a returning field with NULL value
Author mmenaz@lycosmail.com
IBO 3.6D, Delphi 5.1 pro

I've some problems with the 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:
with qryCoda do
begin
WorkV := Lookup('CONTATTO_ID, IN_USO', VarArrayOf([MyCustId,
'S']), 'ADDRESS');
ShowMessage( IntToSTr(Ord(VarIsNull(WorkV))) + ' - ' +
IntToSTr(Ord(VarType(WorkV)=varEmpty)) );
...

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

Thanks

Marco Menardi
P.S: if Jason is reading, did you read my #5324 message? "BUG: wrong
auto generatd UPDATE SQL queries" Thu Mar 22, 2001