Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Array Dimensions - Confusing VFP
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00687552
Message ID:
00687930
Views:
14
I agree, that if you involved in foxpro from another languages, it indeed is confusing. However, it is well documented in vfp help for /append from array/:

"........If the array is one-dimensional, APPEND FROM ARRAY adds one record to the table. The contents of the first array element fill the first field of the newly added record, the contents of the second element of the array fill the second field of the record, and so on.

If the one-dimensional array has more elements than the table has fields, the additional elements are ignored. If the table has more fields than the array has elements, the additional fields are initialized to the default empty value. Here are the default empty values for each field type:...."


>Hello!
>
>All I wanted to say was: It confuses me that a 1 Dimensional Array is used in FoxPro like this.
>
>Dimension myArray(3)
>myArray(1)=1
>myArray(2)=2
>myArray(3)=3
>
>The ?myArray(3,1) returns 1 because FoxPro used it as a Row. I thought it should be 3.
>FoxPro itself used the Array like this:
>myArray(1,1)=1;myArray(1,2)=2;myArray(1,3)=3
>
>What confuses is that FoxPro does NOT give me an ERROR when I try to get the
>?myArray(3,1)...but gives me the first Array Value... why is that so?
>This seems to be a Bug for me.
>
>I tried to make code, that handles 1..n Dimensional Arrays. But it is not Possible for me to get the Dimensions programmatically ....
>
>Greetings
Previous
Reply
Map
View

Click here to load this message in the networking platform