[Gambas-user] LOCK only within OPEN/CLOSE?

Rolf-Werner Eilert eilert-sprachen at ...221...
Tue Jan 19 10:57:35 CET 2010


Just tried to rewrite a function I used for locking files in my Gambas1 
apps. It was based on making a directory for locking, and it delivered a 
Boolean about if locking was successful or not. Think of it this way:

Private Function FileIsLocked(filename As String) As Boolean

Now, when I tried to change the functional part so it uses LOCK instead 
of my original mechanism, I get "Useless LOCK". Does this mean, LOCK can 
only be used within an OPEN/CLOSE statement? Or maybe only directly 
following an OPEN statement? That would be a shame, because this would 
mean doing without my own function and including a lot of code into each 
OPEN session anywhere it is needed.

This wouldn't only blow up my code unnecessarily but also require me to 
browse through all the places where file locking is used.

Or did I get this error message wrong?

Regards

Rolf




More information about the User mailing list