Information générale
Catégorie:
Codage, syntaxe et commandes
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement