[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+----------------+#########################################################
#+-| SET PRINTER TO |----------------------------+############################
#| +----------------+ The SET PRINTER TO command |############################
#| specifies the print device |############################
#+-----------------------------------------------+############################
##############################################################################
##############################################################################
#+--| Syntax |--------------------+###########################################
#| SET PRINTER TO <C-exp> |###########################################
#+--------------------------------+###########################################
##############################################################################
##############################################################################
########+---| Description |-------------------------------------------+#######
########| SET PRINTER TO opens the device <C-exp> and then routes all |#######
########| printer I/O through the device <C-exp>. The default print |#######
########| device is PRN:. Valid print devices are LPT1:,LPT2:,LPT3:, |#######
########| PRN:,COM1: and COM2:. Do not specify the ":" as part of |#######
########| the device name. |#######
########| ----------------------------------------------------------- |#######
########| A filename may be specified as the print "device". In this |#######
########| case, the file is created and opened for writing. |#######
########+-------------------------------------------------------------+#######
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| |#########
#########| SET PRINTER TO "Lpt2" |#########
#########| LIST ALL TO PRINT && Output will be |#########
#########| && sent to lpt2:. |#########
#########| |#########
#########| RUN "c:\command.com /c mode com1:1200,n,8,1,p" |#########
#########| SET PRINTER TO "com1:" && Set the printer to |#########
#########| && the com1: port. |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * Allow user to select a printer through a |#########
#########| * pick list |#########
#########| |#########
#########| VARDEF |#########
#########| CHAR(5) p[5] = "Lpt1","Lpt2","Lpt3","Com1","Com2" |#########
#########| LONG pl |#########
#########| INT svalue,r |#########
#########| ENDDEF |#########
#########| {...} |#########
#########| pl = pick_init() |#########
#########| FOR r = 0 TO 5 |#########
#########| pick_add( p[r] ) |#########
#########| NEXT |#########
#########| pick_list(pl,4,50,8,55,svalue,.F.,.F.) |#########
#########| IF svalue <> 0 |#########
#########| SET PRINT TO pick_str( svalue ) |#########
#########| ENDIF |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 3 |-------------------------------------------+#########
#########| * Open a print "file" |#########
#########| |#########
#########| ACCEPT "Send report to F)ile or P)rinter? " TO ans |#########
#########| IF ans $ "fF" |#########
#########| SET PRINTER TO "report.prn" |#########
#########| ELSE |#########
#########| SET PRINTER TO "Lpt1" |#########
#########| ENDIF |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
SET PRINT
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson