PRINTCSV

PRINTCSV

Top  Previous  Next

 

The PRINTCSV statement outputs CSV format data to a print unit.

 

 

Format

 

PRINTCSV {ON print.unit} var1, var2, ...

 

where

 

print.unitidentifies the print unit to which output is to be directed. If omitted, print unit zero is used.

 

var1, var2, ...is a list of items to be assembled as a CSV format text string. If any of the variables contains field marks, each field is treated as a separate item in the resultant CSV data.

 

 

The assembled CSV format data is output to the requested print unit. Print unit -1 is always associated with the display and cannot be changed. Print unit 0 can be switched between the display and the printer by use of the PRINTER statement. Print units 1 to 255 direct their output to the hold file by default but can be redirected using the SETPTR command.

 

The optional trailing colon suppresses the normal linefeed after the data has been output.

 

 

Example

 

PRINTCSV PROD.NO, QTY

 

This statement prints the contents of the PROD.NO and QTY variables as a CSV format text string.

 

 

See also:

CSV.MODE, INPUTCSV, READCSV, WRITECSV