11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

LOCK<br />

Syntax<br />

LOCK resource.num {THEN statements [END] | ELSE statements [END]}<br />

Description<br />

The <strong>UniBasic</strong> LOCK command reserves a computer resource (such as a device or<br />

file) for the current user process.<br />

The lock is associated with resource.num, not the resource itself. Therefore, a<br />

command that does not check for locks against the resource number will access the<br />

resource even if it is locked. For example, an installation might assign locks 1<br />

through 4 to four system printers. When an application needs to reserve printer 1, the<br />

application executes LOCK 1. For lock effectiveness, all other applications must<br />

check for locks before accessing the resource.<br />

Resources are not automatically unlocked by the termination of the locking program.<br />

The <strong>UniBasic</strong> UNLOCK or ECL QUIT commands must release them. Otherwise,<br />

you can release resources by executing the ECL CLEAR.LOCKS command at<br />

UniData level.<br />

For more information about UniData locks, see Developing <strong>UniBasic</strong> Applications.<br />

LOCK 1-425

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!