>>Hi,
>> Thank you for reply. It work fine if I store them in cursor, but will cause error if stored in array. why?
>>
>>thank you
>
>Because every element of the array is adding to you total variable count and that has a finite limit.
>
No, that's not true; you can do the following:
DIMENSION aArray1[65000], aArray2[65000]
Each array uses a single entry in the NTI, but the array element counter in the value structure is a 16 bit integer, and there's a reason why it's 65000 rather than 64K, but for the life of me I don't remember it. You may run out of string space allocating huge arrays, but it's not a name issue.
>A cursor will be just as fast anyway as it is all in memory (unles it gets so big that VFP pushes it to disk). cursors are very fast.
A cursor may well be faster if grouped aggregation is involved, since the internal Rushmore optimization rates to be faster than making multiple passes through an array in code.