WRITEPRINTER

Top  Previous  Next

Syntax

WRITEPRINTER(handle as UINT,data as ANYTYPE)

Description

Writes data to printer.

Parameters

handle - Handle to printer returned by OPENPRINTER

data - Any built in data type.

Return value

None

Remarks

Numeric data types are converted to text with STR$ before printing, SETPRECISION controls number of decimal places printed. Variable types such as POINTER or MEMORY are converted to a UINT and then to a text before printing. New line characters are not appended to strings.

Not all printers support direct text printing. Printers sold as "GDI Only" do not include built in fonts and will not work with the WRITEPRINTER command. For "GDI Only" printers use the PRINTWINDOW command instead.

See Also: OPENPRINTER, ENDPAGE, CLOSEPRINTER, PRINTWINDOW

Example usage

prtname = GETDEFAULTPRINTER
hPrinter = OPENPRINTER(prtname, "Job 1", "TEXT")
IF hPrinter
    WRITEPRINTER hPrinter, "This is line 1\n"
    CLOSEPRINTER hPrinter
ENDIF