09.12.2012 Views

Basic Characteristics RAPID

Basic Characteristics RAPID

Basic Characteristics RAPID

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.

ReadStr Reads a string from a file or serial channel<br />

Example<br />

ReadStr (Read String) is used to read text from a character-based file or from the serial<br />

channel.<br />

VAR iodev infile;<br />

.<br />

Open "flp1:file.doc", infile\Read;<br />

text := ReadStr(infile);<br />

Text is assigned a text string read from the file file.doc on the diskette.<br />

Return value Data type: string<br />

Arguments<br />

The text string read from the specified file. If the file is empty (end of file), the string<br />

"EOF" is returned.<br />

ReadStr (IODevice [\Time])<br />

IODevice Data type: iodev<br />

The name (reference) of the file to be read.<br />

[\Time] Data type: num<br />

Program execution<br />

The max. time for the reading operation (timeout) in seconds. If this argument is<br />

not specified, the max. time is set to 60 seconds.<br />

If this time runs out before the read operation is finished, the error handler will<br />

be called with the error code ERR_DEV_MAXTIME. If there is no error handler,<br />

the execution will be stopped.<br />

The function reads a line from a file, i.e. reads everything up to and including the next<br />

line-feed character (LF), but not more than 80 characters. If the line exceeds 80 characters,<br />

the remainder of the characters will be read on the next reading.<br />

<strong>RAPID</strong> Reference Manual 9-ReadStr-1

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

Saved successfully!

Ooh no, something went wrong!