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.

OSREAD<br />

Syntax<br />

OSREAD var FROM filename [ON ERROR statements] {THEN statements [END]<br />

| ELSE statements [END]}<br />

Description<br />

The <strong>UniBasic</strong> OSREAD command reads an entire sequential file and assigns the<br />

contents of the file to a variable.<br />

Warning: Do not use OSREAD on large files. If the file is too large for the program<br />

memory, the program aborts and a runtime error message is generated. On large<br />

files, use OSBREAD or READSEQ.<br />

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

ASCII 0 cannot be used in any string variable within <strong>UniBasic</strong>. OSREAD converts<br />

CHAR(0) to CHAR(128) when reading a block of data.<br />

Parameters<br />

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

Parameter Description<br />

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

var Specifies the variable to which to assign the data from the file.<br />

FROM filename The filename must include the entire path to the file unless<br />

filename exists in the current directory.<br />

OSREAD Parameters

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

Saved successfully!

Ooh no, something went wrong!