11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

STATUS Function Return Values<br />

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

described in the following table.<br />

Value Description<br />

0 Successful read.<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 />

Example<br />

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

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

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

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

ELSE STOP<br />

SLEEP 120<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 />

READFWDU 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.<br />

READFWDU 1-619

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

Saved successfully!

Ooh no, something went wrong!