Yeah, that's pretty much what I thought I would have to do... So, I guess the real issue is that RECNO() is NULL if the table is empty? It has no actual value? Hmmm... I could see cases where RECNO() could be -1 though in the case of added records in a buffer. Maybe the best way would be to check if nRecNo is NULL rather than > 0.
>Hi Jay
>
>This modification should do the trick:
>
>cAlias = ALIAS()
>
>nRecNo = RECNO()
>
>Do Something
>
>SELE (cAlias)
>
>IF nRecNO>0
> GOTO nRecNo
>ENDIF
>
>
>>I use the following code in numerous methods to keep record pointers where they belong
>>
>>
>>cAlias = ALIAS()
>>
>>nRecNo = RECNO()
>>
>>
>>Do Something
>>
>>
>>SELE (cAlias)
>>
>>GOTO nRecNo
>>
>>
>>But if the ALIAS was empty then the GOTO will give a record out of range error. Often the Do Something code is using tables/cursors, etc and the goal is to leave open data the same when exiting a method as it was on entering. Any thoughts? Thanks!
>>
>>Regards, Renoir