Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is myArray an array?
Message
From
18/06/2003 04:25:23
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00800787
Message ID:
00801076
Views:
23
>>>Is there any way to find out if myArray is an array? I guess I am looking for a function kind of like type() is for other data types.
>>>
>>>TIA
>>>Einar
>>
>>Einar,
>>Only reliable way is to test with an array function like alen() as Sergey pointed out. Otherwise it might not be an array while returning a type other than 'U'.
>>Cetin
>Cetin,
>I also thought Sergey's method was more roboust so I have ended up using that method for testing for an array. Chuck's solution would also work but it is better to be safe than sorry.
>
>Einar

I was lazy not to show a sample why not :)
? type('IAmNotAnArray[1]')

Function IAmNotAnArray
lparameters tn1, tn2
return tn1 * 2 + iif(empty(tn2),0,tn2)
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
Reply
Map
View

Click here to load this message in the networking platform