09.12.2012 Views

Basic Characteristics RAPID

Basic Characteristics RAPID

Basic Characteristics RAPID

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Example<br />

Limitations<br />

Error handling<br />

Predefined data<br />

Syntax<br />

The string that is read is then converted to a numeric value; e.g. “234.4” is converted<br />

to the numeric value 234.4. If all the characters read are not digits, 0 is returned.<br />

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

IF reg1 > EOF_NUM THEN<br />

TPWrite "The file is empty"<br />

..<br />

Before using the number read from the file, a check is performed to make sure<br />

that the file is not empty.<br />

The function can only be used for files that have been opened for reading.<br />

If an access error occurs during reading, the system variable ERRNO is set to<br />

ERR_FILEACC. If there is an attempt to read non numeric data, the system variable<br />

ERRNO is set to ERR_RCVDATA. These errors can then be dealt with by the error<br />

handler.<br />

The constant EOF_NUM can be used to stop reading, at the end of the file.<br />

CONST num EOF_NUM := 9.998E36;<br />

ReadNum ’(’<br />

[IODevice ’:=’] <br />

[’\’Time’:=’ ]’)’<br />

A function with a return value of the type num.<br />

Related information<br />

Described in:<br />

Opening (etc.) serial channels <strong>RAPID</strong> Summary - Communication<br />

9-ReadNum-2 <strong>RAPID</strong> Reference Manual

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

Saved successfully!

Ooh no, something went wrong!