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.

ReadNum Reads a number from a file or the serial channel<br />

Example<br />

ReadNum (Read Numeric) is used to read a number from a character-based file or the<br />

serial channel.<br />

VAR iodev infile;<br />

.<br />

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

reg1 := ReadNum(infile);<br />

Reg1 is assigned a number read from the file file.doc on the diskette.<br />

Return value Data type: num<br />

Arguments<br />

The numeric value read from a specified file. If the file is empty (end of file), the<br />

number 9.999E36 is returned.<br />

ReadNum (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 timeout function is also in use during program stop and will be noticed in<br />

<strong>RAPID</strong> program at program start.<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-ReadNum-1

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

Saved successfully!

Ooh no, something went wrong!