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.

If the AT clause is not included, <strong>UniBasic</strong> begins reading from the current<br />

location of the file pointer.<br />

Because named pipes must be read from the beginning, the AT clause is not<br />

appropriate for accessing them. If the AT clause is specified, the ON<br />

ERROR executes, and the <strong>UniBasic</strong> STATUS function is set to 2. If the ON<br />

ERROR clause is not included, the program aborts.<br />

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

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

Parameters<br />

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

Parameter Description<br />

var Specifies a variable to which to assign the data read.<br />

FROM file.var Specifies a file from which to read the data.<br />

AT byte.expr Specifies a location in the file from which to begin reading data.<br />

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

When reading a named pipe, do not specify an AT clause. Pipes<br />

are always read with no offset.<br />

LENGTH length.expr Specifies a length of data to read from the file, starting at<br />

byte.expr.<br />

length.expr cannot be longer than the maximum string length<br />

determined by your system configuration.<br />

NODELAY Forces an immediate read of a named pipe regardless of whether<br />

the pipe contains data. If you do not specify NODELAY, the<br />

process attempting to read waits until the pipe is opened for<br />

writing and data is written to it.<br />

If filename is not a named pipe, NODELAY has no effect.<br />

ON ERROR statements Specifies statements to execute if a fatal error occurs (if the file<br />

is not open, or if the file is a read-only file). If you do not specify<br />

the ON ERROR clause, the program terminates under such fatal<br />

error conditions.<br />

OSBREAD Parameters<br />

OSBREAD 1-548

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

Saved successfully!

Ooh no, something went wrong!