Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Looping skip command
Message
From
29/03/2000 13:20:00
Michael Dougherty
Progressive Business Publications
Malvern, Pennsylvania, United States
 
 
To
29/03/2000 12:50:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00352204
Message ID:
00352239
Views:
10
>I mean like a navigation button on the form sort of like the ones that are included automatically when you use the form wizard, except I don't want the Next button to disable at the last entry, I want it to skip back to the first one

nextbutton.click:
sele (tablename)
skip 1
If EOF() && EndOfFile= past last record
  go top && go to first record in index or first physical record
endif
thisform.refresh
prevbutton.click:
sele (tablename)
If BOF()
  go bottom
else
  skip -1
endif
thisform.refresh
The difference in the two code snippets is due to the fact that EOF returns true when the record pointer is past the last record, but BOF actually IS the first record.

BTW, keep in mind that some overly click-happy users may wonder why the list which should be 10 items seems 15, 20, 30+ items long. (they might not be paying attention enough to realize the list is circular- which is one reason most nav buttons are disabled when the user reaches the end of the list in either direction)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform