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.

READ<br />

Syntax<br />

READ dyn.array.var FROM [file.var,] record.ID.expr [ON ERROR statements]<br />

{THEN statements [END] | ELSE statements [END]}<br />

Description<br />

The <strong>UniBasic</strong> READ command reads a record from a file and assigns its contents to<br />

a dynamic array. UniData assigns the first attribute of the record to the first position<br />

of the array, the second attribute to the second position, and so on. If UniData cannot<br />

find the record you specify, it executes the ELSE clause and returns dyn.array.var<br />

empty.<br />

Note: This command does not check for locks. If you are operating in a multiuser<br />

environment, you must use record locks to prevent more than one user from accessing<br />

the same record at the same time. For more information about <strong>UniBasic</strong> record<br />

locking, see Developing <strong>UniBasic</strong> Applications.<br />

Warning: Do not use <strong>UniBasic</strong> READ commands to open or modify binary data in<br />

DIR-type files (for example, BP). Doing so could corrupt data in the file. Instead, use<br />

OSREAD or OSBREAD after executing the <strong>UniBasic</strong> NOCONVERT command.<br />

1-596 <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!