GET

Top  Previous  Next

 

The GET statement reads data from a device previously opened using OPENSEQ.

 

 

Format

 

GET var {, length} {SETTING count} FROM dev {UNTIL term} {RETURNING last} {WAITING timeout}

{THEN statement(s)} {ELSE statement(s)}

 

where

 

varis the variable to receive the data.

 

lengthis the maximum number of characters to read.

 

countis the actual number of characters read.

 

devis the file variable from OPENSEQ.

 

termis a string of termination characters. Receiving any of these will terminate the read.

 

lastis the last character read.

 

timeoutis the timeout period in seconds.

 

The THEN and ELSE clauses are both optional. The THEN clause will be executed if the read action is successful having either read length characters or received a character that appears in term. The ELSE clause will be executed if the timeout period expired or if an i/o error occurs. The two situations can be distinguished by use of the STATUS() function which will return zero for a timeout and a non-zero value for any error.

 

 

See also:

OPENSEQ, SEND