Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can't get a record to lock?
Message
De
16/10/2000 02:48:06
 
 
À
15/10/2000 22:05:44
Raymond Humphrys
Michigan Department of Community Health
Bath, Michigan, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00429650
Message ID:
00429685
Vues:
13
>I can not get the following code to lock a record. What can can cause this failure? I've got multilocks on, and reprocess set to automatic for testing.
>
>STORE recno() to gcreclist2
>DO WHILE NOT RLOCK('myfile')
> RLOCK(str(gcreclist2), 'myfile') &&& Lock clinical record
> IF NOT RLOCK()
> Wait window "Somebody else is working on this record"
> ELSE
> UNLOCK
> ENDIF
>ENDDO
>
>thanks

It looks like your default work area is "MyFile", and the record pointer is already on the record you want to lock. You don't need to go through that many gyrations:
LOCAL llLocked
llLocked = .F.

DO WHILE NOT llLocked
  IF RLOCK("MyFile")
    llLocked = .T.

  ELSE
    WAIT WINDOW "Couldn't Lock Record !"

  ENDIF

ENDDO

UNLOCK IN MyFile
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform