The READU statement has a LOCKED clause that is true if a record is locked.
You can put all your locking ha logic in there.
READU record FROM filevariable,itemID THEN
   code if record exists and isn't locked (optional)
LOCKED
   code to handle locked record condition (optional)
END ELSE
   code if record doesn't exist (required)
END

Now if you put that into a loop you can display a message and give the user the option to try again or abort. And if you put the code into a subroutine you can use that in all your programs with a single line like this.
CALL SR.READU(record,filevariable,ItemID,Option,Err)

On 06/02/2013 21:52, Jon Wells wrote:
Hi all,

I have not looked at the world of record locks since my R83 Pick days.  I'm 
hoping to add the ability for the program I'm working on to:

        * Check if a record is locked
        * Wait until the lock is removed
        * Once the lock is removed, or if the record is not locked:
        * Lock the record
        * Perform the WRITE statement
I'm hoping someone can share an example of how to accomplish this in UniBasic.

Thank you,


Jon Wells
Campbell University
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to