Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FLUSH command did not work
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
FLUSH command did not work
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01530590
Message ID:
01530590
Views:
125
Hi Friends,

The routine below only worked when I used the command GOTO RECORD RECNO ("Table1"), This is correct?

There's another alternative to SET REFRESH. Before using the SET REFRESH tried to use the FLUSH command but this did not work for me.

I come from the clipper and I'm trying to learn more about the best options to use the VFP

Thanks in advance,

Dionísio
* THE TABLE table1 HAS ONLY THE FIELD flag, NO INDEX AND NO DATA BUFFERING

SET REFRESH TO 0,-1

USE Table1 SHARED 

DO WHILE .t.

     GOTO RECORD RECNO("Table1")

     IF Table1->flag

        IF MESSAGEBOX("Routine is being used by another user",5)=2
            EXIT	   	  	
        ELSE
            LOOP 
        ENDIF
	   
     ELSE

        * Flag to warn that the routine is being used
        REPLACE Table1->flag WITH .T.

        IF MESSAGEBOX("Routine is being used by me",1)=2
            EXIT
        ENDIF
		
        * Routine no longer being used by any users
        REPLACE Table1->flag WITH .F.

        IF MESSAGEBOX("Routine no longer being used",1)=2
            EXIT 
        ENDIF

    ENDIF

ENDDO

REPLACE Table1->flag WITH .F.
USE

SET REFRESH TO 0,5
Next
Reply
Map
View

Click here to load this message in the networking platform