Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting an empty value
Message
From
13/05/2008 15:42:06
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01316738
Message ID:
01316764
Views:
14
>>Is there a simple way (without having to check all the datatypes) to get the equivalent empty value for a variable. For example
>>FOO(12) ------------> 0
>>FOO("abcd") --------> ""
>>FOO(DATE()) --------> { }
>>FOO(DATETIME()) ----> { :}
>>etc.
>>
>>I can write FOO if I need to. Just wondering if there is already a feature in the language.
>>
>>Thanks......Rich
>
>You can use the CAST() function:
>
>nVal = CAST("" AS i)
>dVal = CAST("" AS d)
>cVal = CAST("" AS c)
>tVal = CAST("" AS t)
>
Shoot......I forgot about losing the VFP version when you do a preview of the message. This will be in VFP 8 so CAST is unavailable.

Thanks for responding.
Previous
Reply
Map
View

Click here to load this message in the networking platform