Randall,
The strange thing, that I don't understand, is that it looks like my command set order to 1 is simply ignored.
Right before the ENDSCAN command I have
SELECT comision
SET ORDER TO 1
GOTO m.iRec && Return back to the record
WAIT WINDOW "Return to the " + TRANSFORM(m.iRec) nowait
and then replace next 1 ...
I added wait window for myself and it's being executed. I do go to the right record (originally it seems, like I even was not on the right record, since iRec and recno() didn't match).
I may add wait window Order right after set order command, but it's very weird...
>Hello Naomi,
>
>>I have a table set in the particular order and then a
>>
>>I'm doing a SCAN on the table with some FOR and WHILE conditions.
>
>I take it that you're doing the SCAN based on some criteria. What is
>this criteria, and is it being met?
>
>>In the beginning on the scan I'm saving recno, then there are some calculations
>>involving this table, then I restore order on this table and goto saved recno.
>>I also update some fields in this table that don't participate in FOR/WHILE.
>
>This last line that you wrote. You could be changing/advancing the record pointer,
>yet SCAN thinks nothing has changed, and that you're still on the same record; therefore,
>your program might be trying to seek past EOF, in which case SCAN would
>return the error you describe.
>
>Or, your search criteria is not being met at all, and SCAN is letting you
>know (in it's own way) that nothing was found.
>
>>I'm getting record is out of range on the ENDSCAN command.
>>
>>Do you know why I'n having this problem and how can I fix it?
>
>It sounds like you are inadvertently changing the record pointer,
>and SCAN is getting confused. Either that, or your criteria is
>not being met.
>
>Hope this helps,
>
>Randall
If it's not broken, fix it until it is.
My Blog