>I am using VFP 6.0 SP3 with NT 4.0 SP 5 on a Dell 333 with 320 MB of RAM. I have a bizzare matrix type calculation that needs to be performed and I am using an Array to store the data to be calculated.
>
>There are 25 columns in the cursor that are being extracted to an array. The first instance inside the loop is for 1 row. Everytime I run the following code I get the error "there is not enough memory to complete this operation":
>
>COPY TO ARRAY laCR WHILE ISDIGIT(db_yyyymm) AND group_by = "A" FIELDS LIKE cr*
>
>I put a set step prior to this code and then would click on the resume button. I would get the error, suspend and hit the resume button a second time and there was NO problem.
>
>The value of SYS(12) [available memory in bytes]is 655360.
>the value of SYS(1016) [user object memory use] is 830488.
>
>Not sure why the code will go thru fine on the second resume click.
>
>Any ideas?...
No idea of why this happens, but here's one workaround using (ugh) macro-expansion.
LOCAL cSelections, nCtr
cSelections = ''
FOR nCtr = 1 TO FCOUNT()
IF LEFT(FIELDS(nCtr)+' ',2) == "CR"
cSelections = cSelections + ',' + FIELDS(nCtr)
ENDIF
ENDFOR
cSelections = SUBST(cSelections,2)
SELECT &cSelections FROM (ALIAS()) ;
INTO ARRAY laCR ...