Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Looping skip command
Message
De
29/03/2000 13:20:00
Michael Dougherty
Progressive Business Publications
Malvern, Pennsylvanie, États-Unis
 
 
À
29/03/2000 12:50:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00352204
Message ID:
00352239
Vues:
11
>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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform