FPRINT statement

Purpose: Writes literal or variable strings to a file.


 Syntax:

 FPRINT hFile, Comma,Separated,Expressions [;]

 Parameters:

  • hFile Name of handle to 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 FPRINT function.

S10.bas   S103.bas