Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FLUSH command did not work
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01530590
Message ID:
01530599
Vues:
66
>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
>
>
You aren't going to get a return value of 2 from MESSAGEBOX(). (Personally I always use the defined constants from foxpro.h for more readable code. I hate "magic numbers").

You have my sympathy working with code that old ;-) Good luck!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform