Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Going to a RecNo() that is no longer valid
Message
De
03/09/2008 07:58:53
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01344176
Message ID:
01344429
Vues:
15
>Hi Jay,
>
>>I set m.RecNo to the current record number. Then a filter condition happens where that particular record number is no longer available. What is the best way to get to the next previous record number that is available?
>
>LOCATE RECORD m.RecNo
>IF EOF()
>  SKIP -1
>ELSE
>  SKIP +1
>  IF EOF()
>    SKIP -1
>  ENDIF
>ENDIF
>
>This moves to the next valid record, or if such one doesn't exist, to the previous one. By moving to the next first, instead of the opposite way, you get one positive effect on the UI. If the table is shown in a list, the highlighted row now stays at the same place. If you would move to previous record first, the highlight would move upwards in most cases.

I've never used LOCATE that way. Why not use GOTO? Is it the same?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform