Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lock access to a table
Message
De
27/08/2007 12:39:39
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01250664
Message ID:
01250675
Vues:
13
>>I want to make check to see if a process is "locked." I want to keep checking for a period of time (10 seconds or so I guess), then if it is still locked, then skip on out to the RETURN. If it is not locked (becomes available) then I want to do what's in the ELSE block. I'm think of DO WHILE, but I would need to add time-checking logic somewhere and I guess it wouldn't be an ELSE, but another IF?
>>
>>
>>
>>IF Proc_Lock.Locked = .T.
>>	* WAIT WINDOW 'Unable to update HL7 at this time.'
>>ELSE
>>	* Do lots of stuff with a table
>>ENDIF
>>
>>RETURN
>
>lnAttempts = 0
>#define MAX_ATTEMPTS 1000
>do while Proc_Lock.Locked or m.lnAttempts < MAX_ATTEMPTS
>   lnAttempts = m.lnAttempts + 1
>enddo
>
>if not Proc_Lock.Locked
>   * Do your stuff
>endif
Thanks!

Why use DEFINE here? Is it because it is a constant that isn't expected to change at runtime?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform