Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How tell if its an Array?
Message
From
06/07/2002 04:52:52
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
05/07/2002 16:59:04
John Baird
Coatesville, Pennsylvania, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00675762
Message ID:
00675812
Views:
13
>I need to tell wether a variable is an array or not. If I do :
>
>
>
>DIMENSION laArray(2)
>
>laArray(1) = 'My test'
>laArray(2) = 'My test 2'
>
>?VARTYPE(laArray)
>?VARTYPE(laArray(1)
>
>
>
>I get 'C'. This variable will be passed as an array and I need to know if it is an array. How?

Sounds like there is no precise and easy way of knowing if something is an array or not.
You could try to 'produce' an error :

local llIsNotArray
on error llIsNotArray = .t.
alen(laArray)
on error

if llIsNotArray
...

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform