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.

Examples<br />

The following program segment is taken from Appendix A, “Sample Programs,” in<br />

Developing <strong>UniBasic</strong> Applications. READVU checks for locks. If the record is<br />

available, it sets an exclusive lock and reads the multivalued attribute containing the<br />

order number the user wants to delete.<br />

DELETE_RECORD:<br />

* (Assuming the order #'s are on line 12)<br />

READVU ORDER_LINE FROM CLIENT_FILE,CLIENT_NUMBER,12 THEN<br />

LOCATE ORDER_NUMBER IN ORDER_LINE SETTING POSITION THEN<br />

DEL ORDER_LINE<br />

END<br />

WRITEV ORDER_LINE ON CLIENT_FILE, CLIENT_NUMBER, 12<br />

END<br />

In the next example, the program segment reads the seventh attribute of the record<br />

named in the variable ID from the INV file and stores the attribute in the variable<br />

SUPPL. If the record is locked, or if the default file cannot be found, UniData<br />

displays a read-error message.<br />

READVU SUPPL FROM INV,ID,7 LOCKED PRINT "Locked"<br />

ELSE GOTO 2010:<br />

Related <strong>Commands</strong><br />

<strong>UniBasic</strong><br />

CLOSE, DELETE, OPEN, READ, READL, READU, READV, READVL, WRITE<br />

UniData<br />

DEFAULT.LOCKED.ACTION – For information, see the UniData <strong>Commands</strong><br />

<strong>Reference</strong>.<br />

READVU 1-655

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

Saved successfully!

Ooh no, something went wrong!