Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
EOF and BOF with Local Views
Message
De
16/02/2015 13:30:46
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
16/02/2015 08:29:34
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
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:
01615418
Vues:
33
>>>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.
>>
>>Kick in SET ORDER or the like and the BOF() might be on record 10 as well.
>>
>>Update:
>>FILTER
>>INDEX
>>ORDER
>>
>>That's what I remember out of the hip
>
>Yes, of course you are right. My example was for a table without order, without filter, and without deleted records (+ SET DELETED ON).

And then there's also the situation when the cursor contains buffered new records, with negative record numbers. Your Go Top may get you to record -4, then you tableupdate() that record and all of a sudden you may be on the last record - the same one, it's just that its record number has changed to positive. Which adds yet another situation when bof() and eof() need to be checked.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform