>>>>If it is a single cursor, why don't you build that cursor with an explicit rownum added to the end (which will force it to be physical as well) and select n-1 fields from the cursor if you really don't trust recno() of the cursor - still easy to generalize for different table structures for automatic processing, as long as source table has not max fields.
>>>>
>>>>function parameters inAliasOrName, OutFile,Stepsize
>>>>
>>>>and you have no problems in the future...
>>
>>>
>>>How do you Select n-1 fields if you do not know the field names or number of fields (other then by AFIELDS()) ? Any SQL I miss? (And I miss a lot :D )
>>>It's just an catch-the-current-ALIAS-and-process machine. Called from everywhere. Can not alter hundreds of sources ....
>>
>>either create the SQL field list once outside the loop in the method itself on the fly and call the SQL as a macro
>>or
>>use COPY TO ARRAY FIELDS EXCEPT FOR blabla syntax if you feel exceptionally lazy and are not afraid this old xBase-way will removed in the next version ;-))
>
>You mean
>
>COPY TO ARRAY someArray NEXT NNN?
Select Recno() as LutzMagicRowNumberfield, * ;
from (tcSourceAlias) ;
into Cursor "T_Tmp_" + sys(2015)
For lnLoop = 0 To Reccount()/tnBatch
lnLower = 1 + lnLoop*tnBatch
Copy To Array For Between(LutzMagicRowNumberfield, lnLower, lnLower+tnBatch-1) Fields Except LutzMagicRowNumberfield
Next
>
>I let you know when I stop beating myself and return from the hospital. Ouch, Ouch ....
Don't hit yourself in the eye, so that you can identify pretty nurses and forward them here....