Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine if property is array, collection, etc
Message
From
20/10/2008 08:42:49
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01355841
Message ID:
01355851
Views:
26
Thanks very much --- I guess I've grown accustomed to using VarType, and forgot about Type.

Would the following work to distinguish between arrays and collections?
lcProperty = 'oObject.oProperty'
Try
    lnCount = eval( lcProperty + '.Count')
    * Collection here
Catch
   * Array here
EndTry
Thanks

>The VARTYPE() will tell you the type of existing property/variable/field, excluding arrays/collections
>
>* Array/collection
>TYPE(,1)
>
>
>>How can you determine whether a property is:
>>1) an array
>>2) a collection
>>3) an object
>>4) or simple
>>
>>Thanks in advance
Jim Nelson
Newbury Park, CA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform