Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
EOF and BOF with Local Views
Message
De
16/02/2015 07:43:20
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
14/02/2015 11:41:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01615325
Message ID:
01615358
Vues:
52
>Can you use EOF and BOF commands with views. My code reads:
>
>sele v_vendors
>
>do case
> case bof()
> **do something with navigation button
>
> endcase
>
>But nother happens. I'm sure I'm sitting on the first record in the table so therefor shouldn't BOF = .T.?

The use of BOF and EOF in Visual FoxPro is not entirely consistent (with one another). If you have 10 records in total, and go to the last record, EOF() will be .F., RECNO() will be 10; if you then SKIP, EOF() will be .T., and RECNO() will be 11. On the other hand, if you got to the first record, initially BOF() will be .F. and RECNO() will be 1 (fine with me, so far...). But if you then SKIP -1, BOF() will be .T., and RECNO() will still be 1.
In any case, you can use EOF() and BOF() in combination with commands such as SKIP, LOCATE, SEEK(), ... to check whether you are still on a valid record. I believe the only command that will can set BOF() = .T., is a backwards SKIP.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform