Specifications
Chapter 14 171
Using Printer
Sample Program
14. Using Printer
Print_no(*) array and the printer name into the Printer$(*) array.
Lines 860 to 970 Displays the list of supported printers and prompts the user to choose
one of the items by typing in the appropriate number. Then the
program converts the entered value into an integer and stores it into the
Select_pr variable.
Lines 990 to 1020 Issues the printer selection command and then retrieves and displays
the selected printer.
Example 14-1 Printer (printer.bas)
10 DIM Set_pr$[50],Inp_char$[9]
20 INTEGER List_stat,Max_no,Content
30 CLEAR SCREEN
40 ASSIGN @Agt4287a TO 717
50 !
60 OUTPUT @Agt4287a;":HCOP:DPR?"
70 ENTER @Agt4287a;Set_pr$
80 PRINT "Current Printer Selection: "&Set_pr$
90 PRINT "Do you want to change the printer selection?"
100 INPUT "[Y]es/[N]o",Inp_char$
110 IF UPC$(Inp_char$)="Y" OR UPC$(Inp_char$)="YES" THEN
120 PRINT "## Printer Selection ##"
130 Printer_select(@Agt4287a)
140 END IF
150 !
160 OUTPUT @Agt4287a;":SOUR:LIST:STAT?"
170 ENTER @Agt4287a;List_stat
180 !
190 ON ERROR GOTO Content_select
200 Content_select: !
210 PRINT "## Print Content Selection ##"
220 PRINT "Select Content"
230 PRINT " 1: Screen"
240 PRINT " 2: Setup Tables (Stimulas,Cal Kit,Compen Kit,Bin Sort)"
250 IF List_stat=1 THEN
260 PRINT " 3: List Measurement Result"
270 Max_no=3
280 ELSE
290 Max_no=2
300 END IF
310 PRINT ""
320 PRINT "Input 1 to "&VAL$(Max_no)
330 INPUT "Number?",Inp_char$
340 Content=IVAL(Inp_char$,10)
350 IF Content<1 OR Content>Max_no THEN Content_select
360 OFF ERROR
370 SELECT Content
380 CASE 1
390 OUTPUT @Agt4287a;":HCOP:CONT SCR"
400 OUTPUT @Agt4287a;":HCOP:IMAG MON"
410 CASE 2
420 OUTPUT @Agt4287a;":HCOP:CONT SET"
430 CASE 3
440 OUTPUT @Agt4287a;":HCOP:CONT LIST"
450 END SELECT
460 !
470 OUTPUT @Agt4287a;":HCOP"
480 !
490 PRINT "Program finished."
500 END
510 !=============================================