Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Confusion over NULL
Message
De
18/03/2007 05:42:56
 
 
À
15/03/2007 09:30:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01203230
Message ID:
01205157
Vues:
14
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform