|Liberty BASIC Help Online
This command opens the standard Windows Common Printer Dialog. If the user chooses a printer and accepts, the next print job will go to this printer. Accepting a printer also sets the global variables PrinterName$, PrintCollate and PrintCopies to reflect what the user chose for the Printer Name, Collate and Copies. If no printer is accepted, then PrinterName$ is set to an empty string.
To set the font used when LPRINTing text use the PrinterFont$ variable. See also PrinterFont$
If the printer driver can handle printing multiple copies, PrintCopies will be set to "1" and the program only needs to lprint the text one time. If the printer driver cannot handle multiple copy printing, then PrintCopies will contain the number of copies chosen by the user in the printerdialog, and the program must print these copies in a loop. An example follows.
'choose a file to print
filedialog "Print a BAS file", "*.bas", fileToPrint$
if fileToPrint$ <> "" then
print "PrinterName$ is ";PrinterName$
print "PrintCopies is ";PrintCopies
print "PrintCollate is ";PrintCollate
print "PrinterFont$ is ";PrinterFont$
if PrinterName$ <> "" then
open fileToPrint$ for input as #readMe
line input #readMe, line$
txt$ = "Some text to print."
for i = 1 to PrintCopies
Copyright (C) 2003 Shoptalk Systems
Liberty BASIC - http://www.libertybasic.com/