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 15:48:51
 
 
To
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:
01355952
Views:
20
I'd use baseclass. A Collection has a baseclass of 'Collection', and an array doesn't.

>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
Previous
Reply
Map
View

Click here to load this message in the networking platform