Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Confusion over NULL
Message
From
18/03/2007 05:42:56
 
 
To
15/03/2007 09:30:35
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01203230
Message ID:
01205157
Views:
15
>Welcome back, Fabio. "Long time, no see" as they say "over there" ....!
>
Thanks Tore,
I'm fully busy on the work...

>>>Looks like the variable has to be initialized with something different than null to work, e.g.
>>>
>>>
>>>LOCAL zz as Integer
>>>zz=0
>>>zz = null
>>>=MESSAGEBOX(STR(zz,5))
>>>
>>>without zz=0 it gives the error.
>>>
>>>Interestingly, that
>>>local zz as Character
>>>zz=null
>>>=messagebox(val(zz)) && Should give an error too according to Help on VAL
>>>
>>>works.
>>>
>>>By default, all variables are created with logical type, e.g.

>>>
>>>=MESSAGEBOX(TYPE('zz')) returns L, that's why STR doesn't work.
>>>
>>
>>Hi Naomi,
>>STR and others native functions have bugs.
>>
>>The STR() C++'s inner logic it is:
>>
>>IF PARAMETER_DATATYPE<>CORRECT_DATATYPE
>>    ERROR ...
>>ENDIF
>>....
>>
>>
>>A literal NULL is a 'X' DATATYPE and then these works:
>>
>>? STR(NULL,5)
>>? STR(5,NULL)
>>
>>
>>VAL() C++ logic it is correct:
>>
>>IF PARAMETER IS NULL
>>    RETURN CAST(NULL AS RETURN_DATATYPE)
>>ENDIF
>>...
>>
>>
>>Fabio
Previous
Reply
Map
View

Click here to load this message in the networking platform