Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Know what record I am on
Message
From
15/10/1998 01:17:52
 
 
To
14/10/1998 22:12:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00145857
Message ID:
00147014
Views:
32
>>>How can I tell if I am at the top or bottom of a table that is using an index? Ie the record number of the top most record won't be 1 as it is ordered.
>>>
>>>I am trying to code my navigate buttons and want the "Top" button to be disabled when I am at the top of the table with an index set or without.
>>>
>>>Thanks
>>
>>lnRecNo = RECNO()
>>GO TOP
>>IF RECNO() = lnRecNo
>> * At top
>>ENDIF
>>GO BOTTOM
>>IF RECNO() = lnRecNp
>> * At bottom
>>ENDIF
>>GOTO lnRecNo
>
>Thanks, that will do the trick. It took me a minute or two (very tired) to understand what you are doing...
>
>store the record number
>go top if the same we are at the top
>go bottom if the same we are at the bottom
>go back to the record number we were originaly on.
>
>Simple... are there any cavets with this code?
>
>
>Thanks

Two things. Handling deleted records and handling 0 records. Put in some additional checks are you're fine.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform