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.

STATUS Function Return Values<br />

After you execute READBCKU, the STATUS function returns one of the values<br />

described in the following table.<br />

Value Description<br />

0 Successful read.<br />

Example<br />

This example uses the following program to lock the CLIENT file for two minutes:<br />

1-608 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />

10 <strong>UniBasic</strong> found and read a duplicate alternate index key value, and ECL<br />

DUP.STATUS is on.<br />

STATUS Function Return Values<br />

OPEN 'CLIENTS' TO tmp ELSE STOP<br />

SETINDEX 'LNAME', 'Smith' ON tmp<br />

READBCKU rec FROM tmp THEN PRINT rec:", ":rec:" ":rec<br />

ELSE STOP<br />

SLEEP 60<br />

END<br />

If you execute the following program:<br />

OPEN 'CLIENTS' TO tmp ELSE STOP<br />

SETINDEX 'LNAME', 'Smith' ON tmp<br />

FOR X = 1 TO 5<br />

READBCKU rec FROM tmp THEN PRINT rec:", ":rec:" ":rec<br />

ELSE STOP<br />

NEXT X<br />

END<br />

Notice that execution halts on the second program until the first program unlocks the<br />

record associated with “Smith.” This is because commands that set exclusive locks<br />

cannot access records lock with any kind of lock.

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

Saved successfully!

Ooh no, something went wrong!