Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RLOCK('name') ALWAYS returns .F.
Message
From
14/09/2001 11:39:00
 
 
To
14/09/2001 11:36:37
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00556204
Message ID:
00556536
Views:
16
Now for really bizzare part. Created an excutable file, ran program and it seems to work. Using the Debugger to trace changes I made is when it did not work. ??????

>>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform