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.

Writing to Other Types of Files<br />

For files that are not named pipes, processing is determined by the presence or<br />

absence of the AT clause:<br />

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

AT clause specified – <strong>UniBasic</strong> begins writing to the file at the offset<br />

specified by byte.expr.<br />

AT clause not specified – <strong>UniBasic</strong> begins writing to the current location of<br />

the file pointer.<br />

After successful execution of OSBWRITE against a file that is not a named<br />

pipe, the file pointer remains at the next byte after the data is written.<br />

Parameters<br />

The following table describes each parameter of the syntax.<br />

Parameter Description<br />

expr Specifies the expression to write to the file.<br />

ON | TO file.var Specifies the file on which to write the expression.<br />

AT byte.expr If byte.expr is 0, the write begins at the beginning of the file.<br />

NODELAY Forces an immediate write.<br />

Include NODELAY to write to a named pipe immediately<br />

regardless of whether the pipe contains data. If you do not<br />

specify NODELAY, the process attempting to write waits until<br />

the pipe is opened for reading.<br />

ON ERROR statements Specifies statements to execute if the OSBWRITE statement<br />

fails with a fatal error because the file is not open, an I/O error<br />

occurs, or UniData cannot find the file.<br />

If you do not specify the ON ERROR clause and a fatal error<br />

occurs, the program terminates.<br />

OSBWRITE Parameters

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

Saved successfully!

Ooh no, something went wrong!