NULL values not rendered as void in Director

Pierre Rossel prossel2 at myrealbox.com
Wed Sep 20 10:14:25 CDT 2006


Hello Ruslan,


> This issue already was raised once by some V4MD developer.
> After first deep look we have not find solution, frankly saying..

I think I gave you the solution in mantis.


> Please add this issue into Mantis, so we will see it in list each day.

Done. It's number 0001849 


> > Put cursor.field(1).value
> > -- 0                          <-- WRONG: should be void
> 
> STOP. This is correct answer. Idea is that before check value you need
>     check field(1).IsNull()

I don't agree. I have a wrapper function to do the query and the field
object is no longer available after the wrapper returns its results. So I
would have to check in the wrapper every value with IsNull to set the result
to void anyway. Why return void from the xtra ? 

Void values can be used in arithmetic operations as it was a 0. But it can
also distinguished from 0 with the voidP() function for those who need it.

For the results a lists (getRecord and getRecordsAsPropList) there is no
reason not to use the void value in Director.
Since Director offer a way to distinguish a void value from a 0 value, why
not using it for cursor.field(1).value as well ? 


> But Hmm, Director has ability to have VOID value...rare case.

No. Not rare. Very common actually. There is even the function voidP() to
test if a value is void.

Direct link to mantis:
http://www.valentina-db.com/bt/view.php?id=1849

HTH

Pierre Rossel



More information about the Valentina mailing list