Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Phantom Record
Message
From
28/12/2001 11:02:19
 
 
To
28/12/2001 10:02:02
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00598707
Message ID:
00598818
Views:
18
Jeffrey,

If there are no records in a table you are automatically at EOF(). However, you can still scatter memvars (for example) and have them populated as though you did a SCATTER MEMVAR BLANK.

If you have records in a table doing a GO TOP or LOCATE (I recommend LOCATE) will not return a .T. as you might expect. Issuing a GO BOTTOM will also not return a .T. either. In each case you need to perform an additional SKIP -1 or SKIP and then test for the condition.

Here's an example:
 SELECT PATIENT_VIEW
 LOCATE
 IF NOT BOF()  && Covers condition where table has no records.
    SKIP -1    && Move record pointer to trigger BOF() possible condition.
    IF BOF()   && Let's us know we were indeed at BOF().
       LOCATE  && Reposition pointer and reset BOF() flag.
    ELSE
       SKIP    && Go back to where we started.
    ENDIF
 ENDIF
>Here what I have:
>
>SELE PATIENT_VIEW
>GO TOP
>
>IF BOF()
> THISFORM.TOPFILE = .T.
> THISFORM.ENDFILE = .F.
>ENDIF
>
>but it's not catching and reading BOF(). the topfile property and endfile property are being set to .F. That's why the buttons are refreshing correctly.
Best,


DD

A man is no fool who gives up that which he cannot keep for that which he cannot lose.
Everything I don't understand must be easy!
The difficulty of any task is measured by the capacity of the agent performing the work.
Previous
Reply
Map
View

Click here to load this message in the networking platform