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.

UNLOCK<br />

Syntax<br />

UNLOCK [num.expr]<br />

Description<br />

The <strong>UniBasic</strong> UNLOCK command unlocks predefined computer resources reserved<br />

by the LOCK command. Resource numbers range from 0 through 63. If you do not<br />

specify a resource number, the system releases all locks you have set. If there are no<br />

locked resources at the time of execution, the statement does not have any effect.<br />

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

does not check for locks against the resource number will access the resource even if<br />

it is locked. For example, an installation might assign locks 1 through 4 to four<br />

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

executes LOCK 1. All other programs must check for locks before accessing the<br />

resource for the lock to be effective.<br />

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

You must use the <strong>UniBasic</strong> UNLOCK or ECL QUIT commands to release them. You<br />

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

UniData level.<br />

Example<br />

In the following example, the program statement unlocks all computer resources<br />

reserved by the current user:<br />

UNLOCK<br />

1-892 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong>

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

Saved successfully!

Ooh no, something went wrong!