FPRINT statement

Purpose:

FPRINT writes literal or variable strings to a file.

Syntax:

FPRINT hFile AS FILE, Comma,Separated,Expressions [;]

Parameters:

  • Data type: FILE
    hFile The handle of file to which strings are written.
  • Comma,Separated,Expressions one or more expressions to be printed. An expression can be a literal or variable number or string, a member of an array or a user defined type, or an inlined function.
  • ; [OPTIONAL] A semi-colon at end of FPRINT statement line suppresses linefeed and causes the next FPRINT parameter to print to file on the same line as the previous FPRINT.

Remarks:

FPRINT will allow the use of stderr as the file handle as in:

    
FPRINT stderr, "An error has occured"

in order to be able to send formatted output to the stderr.

Example:

FPRINT FP1, "This is a line of text"

Remarks:

FPRINT serves the same purpose as the PRINT# syntax used in other BASIC dialects.

BCX Console Sample Programs using the FPRINT function.