Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to tell if variable or field
Message
From
10/04/2008 15:24:38
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01309758
Message ID:
01309789
Views:
6
>>>I don't see a problem with the object here. For me this looks like a safe code.
>>
>>
>>yourunknown = CREATEOBJECT([EMPTY])
>>? VARTYPE(m.yourunknown)
>>
>>
>>Just because objects are memory variables also.
>
>Right, it would be O, I think. So, what is the problem with the code above? vartype(m.unknown) = 'O', so it's not a field.
>
>vartype(unknown) <> "U" and vartype(m.unknown) = 'U'
>  This is a field - no exceptions except for the case of select m as an alias
If you have no field with the name you check for, you can't tell whether you have a memvar or an object with that name. In other words, you will get the same result with an object call yourunknown, and a mevar called yourunknown.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform