GET


The GET statement reads a block of data directly from a device.

 

COMMAND SYNTAX

GET Var {,length} {SETTING Count} FROM Device {UNTIL TermChars} {RETURNING TermChar}  {WAITING Timeout} THEN | ELSE statements 

 

SYNTAX ELEMENTS

Var is the variable in which to place the input (from the previously open Device). 

If length is specified, it limits the number of characters read from the input device.

If the optional Count option is used, it returns the number of characters actually read from the device.

Device is the file variable associated with the result from a successful OPENSEQ or OPENSER command. 

TermChars specifies one or more characters that will terminate input.

TermChar The actual character that terminated input.

Timeout is the number of seconds to wait for input.  If not input is present when the timeout period expires, the ELSE clause (if specified) is executed.

 

NOTES

The GET statement does no pre-or post-processing of the input data stream - nor does it handle any terminal echo characteristics.  It is assumed that if this is desired the application - or device drive - will handle it.

If the length and timeout expressions are not specified, the default input length is one (1) character.  If no length is specified, but TermChars are, there is no limit to the number of characters input.

The GET syntax requires that either a THEN or ELSE clause, or both, be specified.  If the data is received without error, the THEN clause is executed.  If the data cannot be received (or a timeout occurs), the ELSE clause is executed.

See also: GETX

 


jBC