GetField returns different value from GetRecordAsPropList

Pierre Rossel prossel2 at myrealbox.com
Fri Jun 23 09:55:36 CDT 2006


Hello Ruslan,


>             if( isNull )
>             {
>                 pMmValue->ValueRelease( &fldValue );
>             }
> 
> If field value is Null, then we simply make empty fldValue.
> I.e. We DO NOT put string <Null> there.
> I think this is Director issue.

I am not a XDK specialist, but I downloaded it and read a bit through the
doc. I also looked in PRegEx xtra source code to try to find the way to set
a value to void.

Are you sure that a simple ValueRelease() call will set the value to void in
property list ? I guess the ValueRelease will only decrement the reference
counter.

But the point is: if there is no chance to have a 1.11 update, even if there
is a bug, is it worth looking for a solution in the source code ?


> The correct code to extract value from this field is:
>     
>    curItem = MyQuery(
>         "SELECT * FROM MediaItem WHERE RecID=" & p_iMediaItemId)
> 
>     isNull = curItem.GetFieldIsNull("mediaData")
>  
>     if( not isNull )
>        value = curItem.GetField("mediaData")
> 
> 
> You cannot just extract value. If you do this, you will get 
> ZERO for numeric
> fields, and empty string for STRING/VARCHAR/TEXT.

Why not a real void value if the field is NULL ?
One that will make voidP(value) return true.


> ** Function GetRecordAsPropList() do this code self. It check 
> if field us
> null, and put values into list...Why Director show you <Null> 
> I don't know.

Maybe because the way the value is set when the field is NULL is not the
best way to set a void value.


> May be this is normal for VOID varaibale ?

No. There are lots of use of void values in Director and I have never seen
the <NULL> value before. Note this is not a string.


> Have you try e.g. 
> 
>     var = void
> 
>     put var 

Yes. The result is:
-- <Void>

It is not a string, which would be enclosed in quotes, but the way Director
shows a variable that has no value. It is different from the value 0,
although it is considered as a 0 in operations such as:

Put void = 0
-- 1

This is the reason of the voidP() function which will tell whether a value
is void or not.

Put voidP(0)
-- 0

Put voidP(void)
-- 1


Pierre Rossel



More information about the Valentina mailing list