Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Arrays
Message
From
25/01/2001 18:45:46
 
 
To
25/01/2001 18:43:02
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Arrays
Miscellaneous
Thread ID:
00468777
Message ID:
00468872
Views:
27
>>>>>At Least it looked good in theory :-)
>>>>
>>>>I did not try it, but the docs say thats what it will do, (count actual elements, as opposed to the defined array size).
>>>
>>>It does NOT do what the docs say it will do. oh well
>>
>
>
>>No, it does EXACTLY what the docs say it will do. If it's not an array, it's not an array, that's all.
>>
>>If you want to test if a variable is an array or not, you can do:
>>
>>IF TYPE('laArray[1]')<>"U"
>>
>>You can't use VARTYPE here or you could possibly get an error if the variable is not defined at all!
>
>Fred, you're losing me, here. I assumed we KNEW we were working with an array and were trying to find out if it is empty. I created an array, put one element in it and ran the command, which returns the defined size, not the number of elements containing data, which is what I thought it was saying.
>
>What the doc is saying, on 2nd look is that it will return the total number of elements in the array as defined, even if it is 2 dimensional or whatever.
>so if you have:
>
> dimension MyArray(4,4)
> nlen = ALEN(MYArray,0)
>? Nlen && this returns 16
>
>
>My mistake from not reading closer.
>
>Jim

OK, even if we know we're working with an array, ALEN(x,0) will never return 0. There is always at least one defined element, or else it's not an array.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform