Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RLOCK('name') ALWAYS returns .F.
Message
De
14/09/2001 11:36:37
 
 
À
14/09/2001 10:53:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00556204
Message ID:
00556532
Vues:
16
>As suggest here is releavent code (my biggest problem is I am modifying code I did not write so I have to figure out what it should be doing.
>
>SELECT piorders
>GO TOP
>lnIIine	= 1
>lnInstockRecno = RECNO('instock')
>SCAN FOR piorders.nreqqty <> 0
>  IF RLOCK('instock')
>     m.lnNewQty = IIF( instock.nordlev + nstock.nmaxlev > 0 , ;
>        instock.nqty - piorders.nreqqty , 0 )
>     REPLACE ;
>       instock.nqty WITH m.lnNewQty ;
>       IN instock
>     IF instock.nqty = 0 AND (NOT instock.lreorder)
>       REPLACE ;
>         ldisflag WITH .T., ;
>         ldflag   WITH .F.  ;
>         IN instock
>     ENDIF
>     more code
>    lnIIine = lnIIine + 1
>    UNLOCK IN instock
>   ENDIF
>ENDSCAN
>
>

Nothing is jumping out at me in your code.
What happens if you go to the command window and try to lock the record?
select instock
goto recordInQuestion (OR do a SEEK)
? rlock('instock')
Also, there is no need to lock the record every time through the scan, unless you have some deep, dark secrets in your 'more code' section. It appears that the entire scan updates the same record in the 'instock' table. You could lock the record at the beginning of the scan, and unlock it at the end.

I don't see any code that moves the record pointer in the inStock table.

Another option to consider (again, assuming that the entire scan is only affecting one record in inStock), is to only update the inStock record one time, after the end of the scan process.
Steve Gibson
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform