Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you tell if a property is an array (version 8)
Message
 
 
To
07/04/2009 17:06:47
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01393713
Message ID:
01393720
Views:
97
This message has been marked as the solution to the initial question of the thread.
>I have a question about determining whether a variable is an array: From the Help file: (version 8, not 9!)
>
>You can also use the TYPE( ) function to check if a memory variable is an array. For example:
>? TYPE("myarray[1]")#"U"

>
>This apparently works as well for properties. Except for one special counter-example - native properties:
>
>Guesses on the results from the following?
>
?Type("loForm.visible(1)")
>?Type("loForm.visible(0)")
>
>Is there some other consistent method for determining whether a property is an array?

Try
type("alen(loForm.arrProperty)") <> "U"
or
try
  lnDim = alen(loForm.arrProperty,1)
catch to loNotArray
endtry
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform