Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Field exists?
Message
From
13/01/2008 10:24:46
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01281442
Message ID:
01281451
Views:
7
>? VARTYPE (CONFIG2.version)
>
>returns C
>
>? VARTYPE (CONFIG2.versionxxx)
>
>return an error message
>
>
>Is it the right way ?
>I was expecting something as .F.

TYPE() and VARTYPE() return the variable or field type or a "U" is it does not exist.
IF VARTYPE( MyFile.MyField ) <> "U" && it exists

or

IF TYPE( "MyFile.MyField" ) <> "U"  && it exists
Or you can test if the field exists and has the expected type:
IF TYPE( "MyFile.MyField" ) = "C"  && if the field is a char
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform