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.

INMAT Function Return Values<br />

After you execute OPEN, the INMAT function returns one of the values described in<br />

the following table.<br />

Examples<br />

In the following example, the program statement opens the data file ACCREC in<br />

read-only mode. Because no file variable is specified, ACCREC becomes the default<br />

file.<br />

OPEN 'ACCREC' READONLY ELSE STOP 'Cannot open ACCREC'<br />

In the next example, the program statement opens the dictionary file ACCPAY,<br />

assigning it to the file variable AP. If UniData does not find the file, “File not found”<br />

displays.<br />

OPEN 'DICT', 'ACCPAY' TO AP ELSE PRINT 'File not found'<br />

In the next example, the program segment opens the CLIENTS file to the file variable<br />

CLIENT. If it is not found, UniData executes the ELSE statements, printing an error<br />

and setting a flag to 1.<br />

OPEN 'CLIENTS' TO CLIENT ELSE<br />

PRINT 'NO CLIENT'<br />

OPEN.ABORT = 1<br />

END<br />

IF OPEN.ABORT THEN PRINT 'Aborting on open error';STOP<br />

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

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

Value Description<br />

n The number of modulos for the file.<br />

0 The file opened is a directory.<br />

INMAT Function Return Values<br />

CLOSE, DELETE, OPENSEQ, OSOPEN, READ, WRITE<br />

OPEN 1-536

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

Saved successfully!

Ooh no, something went wrong!