Cetin, Fabio, thanks.
No matter under what angle we consider this issue or how we call it, it is clear that we may meet problems if arrays (one-dimensional or not) are not defined the very same way (like in the example I provided in original post).
Probably it should be recommended to always redefine array like Cetin did:
dime a1[200]
.....
*or
copy field onefield to array a1
....
* Now redefine the array,
* Make sure that set compatible is OFF, otherwise the array will be destroyed. Thanks to Igor Koroljov for this comment.
set compatible OFF
Dimension a1[alen(a1,1),max(1,alen(a1,2)]
*
Thanks
>>Cetin,
>>
>>Yes, I understand that VFP works this way, but why? It look like a bug to me:
>>
>>
>>dimension a1[200]
>>dimension a2[200,1]
>>
>>One may then ask, how many columns there are in a1 and in a2?
>>
>>?Alen(a1,2)
>>?alen(a2,2)
>>
>>
>
>Yuri, a bug is sure.
>
>When VFP use a array in COPY/APPEND/... commands
>it see a one dimensional array as a "one row x N columns"
>
>
>CLEAR
>DIMENSION onedimension[2]
>
>? ALEN(onedimension,1),ALEN(onedimension,2)
>
>onedimension[1] = 1
>onedimension[2] = 3
>
>CREATE CURSOR TEST (AA I,BB I)
>APPEND FROM ARRAY ONEDIMENSION
>BROWSE
>* then expected output of
>* ? ALEN(onedimension,1),ALEN(onedimension,2)
>* is 1,2
>