Information générale
Catégorie:
Codage, syntaxe et commandes
I have found that if you execute _tally immediatley after the query it is correct.
SELECT * FROM table INTO Cursor
IF _TALLY > 0 .. etc
If you have any commands in between the query and your _tally command sometimes the _tally value has been changed by something inside VFP. ( don't ask me what I just know it happens )
SELECT * FROM table INTO Cursor
* some code in here
IF _TALLY > 0 .. etc
For a way to always have a tally accurate, immediately after a query I assign _tally to a variable before doing anything else. This way I can do other things necessary before I check _tally and go from there based on it value.
SELECT * FROM table INTO Cursor
lnTally = _TALLY
It is the same reason I always have a SELECT TableAlias as the last line of a set of instructions inside a SCAN ... ENDSCAN, because on occasion VFP forgets what table it is scanning when it hits the ENDSCAN.
MLW
Précédent
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