Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need good why to return to a position in a file.
Message
From
13/03/1999 20:01:20
 
 
To
10/03/1999 12:31:12
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00195887
Message ID:
00197301
Views:
15
>>Have needed many time to "hold_recno = recno()", do something, then "go hold_recno". This does not work if recno was eof or bof. What is a good way to save the record pointers position, and then return exactly there, whether it is a good recno, bof or eof.
>>
>>Thanks - Brenda
>
>Hi Brenda,
>You can use this way to return the record pointer to exact position of a file:
>-----------------
>
>Hold_RecNo = IIF( BOF(), 0, IIF( EOF(), -1, RecNo()))
>
>...Do something...
>
>Do Case
> Case Hold_RecNo = 0
> Go Top
> If !BOF()
> Skip -1
> EndIf
> Case Hold_RecNo = -1
> Go Bottom
> If !EOF()
> Skip 1
> EndIf
> Otherwise
> Go Hold_RecNo
>EndCase
>----------------
>
>Alex

looks like a job for a HoldRecNo object, it could even store a sequence of recnos
Previous
Reply
Map
View

Click here to load this message in the networking platform