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.

OSWRITE<br />

Syntax<br />

OSWRITE expr {ON | TO} filename [ON ERROR statements]<br />

Description<br />

The <strong>UniBasic</strong> OSWRITE command writes the contents of an expression to a<br />

sequential file.<br />

Note: UniData uses the ASCII 0 character [CHAR(0)] as a string-end delimiter. For<br />

this reason, you cannot use ASCII 0 in any string variable in <strong>UniBasic</strong>. If <strong>UniBasic</strong><br />

reads a string with a CHAR(0) character, and then the character is converted to<br />

CHAR(128), OSWRITE converts CHAR(128) to CHAR(0) when writing a block of<br />

characters.<br />

Parameters<br />

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

Parameter Description<br />

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

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

ON | TO filename Specifies the name of a sequential file to which to write.<br />

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

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

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

OSWRITE Parameters

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

Saved successfully!

Ooh no, something went wrong!