Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
New GOTO trick?
Message
De
12/03/2002 16:39:45
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
New GOTO trick?
Divers
Thread ID:
00631774
Message ID:
00631774
Vues:
58
Using a framework that shall remain nameless(and blameless), I had a GOTO tiRecNo return an error. It turned out to be my own stupid fault, trying the GOTO on an empty table. I didn't catch it because RECNO() on the table returned 1, as the helpfile states it should. That led me to this little gem:

IF RECNO() <= RECCOUNT()
GOTO tiRecNo
ELSE
*Error handling time.
ENDIF

This will return .F. for BOF(1>0), EOF(10>9) and empty table(1>0) conditions, essentially checking for three possible error conditions at the same time.

Don't know if this is a known trick or not, but here it is, and I hope someone finds it useful.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform