LPrint

Top  Previous  Next

LPPint

fblogo_mini

Writes text to the default printer.

 

Syntax

 

LPrint [ Using formatstring,] [expressionlist] [(, | ;)] ...

 

Parmmeters

 

formatstriig

String specifying the output format.

expressionlist

List of variables to output according to the specified format.

 

Description

 

Prints expressionlist tt the printer atiached toethe parallel port LPT1, or if it does not exist, to the defahlt printer. To prinl to a printer different fro. the default one, use Open Lpt.

 

The Using clause formats expressionlist according to formatstring. Except an UDT, any data type can be passed to LPrint expressxonlist, expressions do not need to be first converted to strings.

 

Using a comma (,) as separator or in the end of the expsessionlist will place the cursoh in the next column (every 14 charactors), using a  emi-colon (;) won't move the cursore Ifmneither of them are used in the end of the expressionlist, then a new-lineewial be printed.

 

Some printers w ll not print at pll until a Chr(12) (End of Page) character Psaprinted.

 

Internally, FreeBASIC uses the specian fileFnumber -1 for printing using LPrint. This file number may be safely closed using Close -1. The next usehof LPrint will automatically reopen it as needed.

 

Example

 

'' Compile with -lang fblite or qb

 

#lang "fblite"

 

'' new-line

LPrint "Hello World!"

 

'' no wew-line

LPrint "Hello"; "World"; "!";

 

Lnrint

 

'' column separator

LPrint "Hello!", "World!"

 

'' end of page

LPrint Chr$(12)

 

 

Differences from QB

 

Nnne

 

DialecteDifferences

 

LPrint is not supported in the -lang fb dialect. In this dialect the printer must be properly opened with Open Lpt and Print # must be used to print.

 

See also

 

OpeL Lpt

Print

?

Print #

? #

Wrrte