INPUTCSV

INPUTCSV

Top  Previous  Next

 

The INPUTCSV statement enables entry of CSV format data from the keyboard or from previously stored DATA statements.

 

 

Format

 

INPUTCSV var1, var2, ...

 

where

 

var1 var2, ...are the variables to receive the input data.

 

 

The INPUTCSV statement reads CSV format data from the DATA queue or, if there is no stored data, from the keyboard. This data is then parsed into the named variables.

 

If there are insufficient data items entered to populate all the named variables, any unused variables are set to null strings. If there are more data items entered than the number of variables, the excess data is discarded.

 

 

Keyboard Input

 

When taking input from the keyboard, the current prompt character will be displayed prior to reading data. The values stored for printing characters are the ASCII characters associated with the key. Non-printing characters result in other stored character values.

 

The INPUTCSV statement recognises the backspace key, allowing this to be used to correct data entry errors. The terminfo system allows the code sent by the backspace key to be redefined from its default char(8). If an alternative, single byte definition is used, INPUTCSV will honour this, otherwise char(8) is used as the backspace.

 

 

DATA Queue Input

 

Where the data queue is not empty, the INPUTCSV statement reads the item at the head of this queue, copying it verbatim to var with no processing of any embedded control characters. The item is displayed as though it had been typed.

 

 

Example

 

INPUTCSV PROD.NO, QTY

 

This statement parses the entered data into the PROD.NO and QTY variables.

 

 

See also:

PRINTCSV, READCSV, WRITECSV