<<

Contents

Search

>>

 

OUTPUT

 

 

Instruction

 

 

Syntax:

OUTPUT <File Number>, [USING <STRING-EXPRESSION>;] <List of expressions>[;] ON ERROR … END

 

<File Number> = <NUM-EXPRESSION>

 

Meaning:

Writes data to a sequential file (analogous to LPRINT).

 

The formatting of the output is specified with the instruction LPRINT.

 

In the case of an error the block ON ERROR … END is executed.

 

If several values (separated by comma or semi-colon) are put out with an OUTPUT instruction, no separators are written into the file. If the values are to be read again with INPUT, a separator must be put out additionally between the values.

 

Separators are the end of file, the comma or if a value is enclosed by quotation marks. (e.g. "123.45")

 

The end of file is always written if there is no comma or semi-colon behind the last expression in the OUTPUT instruction.

 

Parameter:

File Number

Number of sequential file

 

Sample:

OPEN OUTPUT,1,"XYZ" ON ERROR ... Error ... END

 

/* Output: -123.4 , 8 ,Test

K = -1.234
L = 8
H$ = "Test"
OUTPUT 1,K;",";L;",";H$

   ON ERROR ... Error ... END

 

/* Output: "1",20,"Test"

K = 1
L = 20
OUTPUT 1,CHR$(34);K;CHR$(34);L;",";CHR$(34);H$;CHR$(34);

       ON ERROR ... Error ... END

    

CLOSE 1 ON ERROR ... Error ... END

 

See also:

TAB

OPEN

LPRINT

INPUT

LINE INPUT

Error numbers