Home » Archimedes archive » Acorn Computing » 1994 08.adf » 9408 » PD/Playdays/!Playdays/Disc2/One/aa/ab/ac/ad/af/ag/ah/ai/PrintDrive/Example1

PD/Playdays/!Playdays/Disc2/One/aa/ab/ac/ad/af/ag/ah/ai/PrintDrive/Example1

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn Computing » 1994 08.adf » 9408
Filename: PD/Playdays/!Playdays/Disc2/One/aa/ab/ac/ad/af/ag/ah/ai/PrintDrive/Example1
Read OK:
File size: 0DBB bytes
Load address: 0000
Exec address: 0000
File contents
   10REM > Example1
   20
   30REM demonstrate a simple use of the printer drivers
   40REM by Ben Summers
   50
   60
   70
   80SYS "PDriver_Info" TO type%, x_resolution%, y_resolution%, features%, name$, halftone_x_res%, halftone_y_res%
   90
  100MODE 0
  110
  120PRINT "Test printout using "name$
  130PRINT
  140PRINT "Press any key to see what we're going to print..."
  150G = GET
  160CLS
  170
  180REM draw a white page
  190SYS "ColourTrans_SetGCOL",&FFFFFF00,,,0,0
  200RECTANGLEFILL 0,0,1024,1280
  210
  220PROCdraw_rectangle
  230
  240VDU4
  250PRINT "Press any key to print it out..."
  260G = GET
  270
  280CLS
  290
  300PRINT "Printing page"
  310
  320
  330REM ******************************************************************
  340
  350REM claim some useful areas of memory
  360DIM rectangle% 16, transform% 16, plot% 8
  370DIM to_draw% 16
  380
  390
  400REM ******************************************************************
  410
  420REM start off the print job
  430
  440title$ = "Test print job"
  450
  460this_job% = OPENOUT("printer:")
  470SYS "PDriver_SelectJob", this_job%, title$ TO old_job%
  480
  490ONERROR SYS "PDriver_AbortJob",this_job%: CLOSE#this_job%: PRINT REPORT$ " at line " ERL: END
  500
  510REM ******************************************************************
  520
  530REM declare all the fonts we're going to use
  540REM which is none in this case
  550SYS "PDriver_DeclareFont", 0, 0, 0
  560
  570
  580REM ******************************************************************
  590
  600REM set up a rectangle
  610
  620low_x% = -2
  630low_y% = -2
  640high_x% = 514
  650high_y% = 514
  660x_scale = 1
  670y_scale = 1
  680REM position of the bottom left hand corner is an inch in and an inch up
  690REM from the bottom left hand corner of the page
  700pos_x% = 72000
  710pos_y% = 72000
  720
  730REM an arbitary, but carefully chosen, number to identify this rectangle
  740id% = 42
  750
  760REM background colour of the rectangle is white
  770col% = &FFFFFF00
  780
  790rectangle%!0  = low_x%
  800rectangle%!4  = low_y%
  810rectangle%!8  = high_x%
  820rectangle%!12 = high_y%
  830transform%!0  = x_scale * 2^16
  840transform%!4  = 0
  850transform%!8  = 0
  860transform%!12 = y_scale * 2^16
  870plot%!0 = pos_x%
  880plot%!4 = pos_y%
  890SYS "PDriver_GiveRectangle", id%, rectangle%, transform%, plot%, col%
  900
  910
  920REM ******************************************************************
  930
  940REM right then, let's start the print job off
  950
  960copies% = 1
  970
  980REM page number is unimportant
  990page% = 0
 1000
 1010SYS "PDriver_DrawPage", copies%, to_draw%, page%, 0 TO more%, , id%
 1020
 1030
 1040REM ******************************************************************
 1050
 1060REM draw the lovely rectangle as many times as required
 1070
 1080WHILE(more% <> 0)
 1090  IF(id% = 42) THEN
 1100    PROCdraw_rectangle
 1110  ENDIF
 1120
 1130  SYS "PDriver_GetRectangle", , to_draw% TO more%, , id%
 1140ENDWHILE
 1150
 1160
 1170REM ******************************************************************
 1180
 1190REM ... and finally, end this print job
 1200
 1210SYS "PDriver_EndJob", this_job%
 1220SYS "PDriver_SelectJob", old_job%, 0
 1230
 1240CLOSE# this_job%
 1250
 1260
 1270REM ******************************************************************
 1280
 1290REM bye, bye. See you in the next example program
 1300
 1310PRINT "Finished"
 1320
 1330END
 1340
 1350
 1360REM ******************************************************************
 1370
 1380REM procedure to draw the rectangle... note that it's the same one
 1390REM which draws the picture on the screen
 1400
 1410DEFPROCdraw_rectangle
 1420  REM set the colour to black
 1430  SYS "ColourTrans_SetGCOL",&00000000,,,0,0
 1440
 1450  REM draw a simple shape
 1460  MOVE 0,0
 1470  DRAW 0,512
 1480  DRAW 512,512
 1490  DRAW 512,0
 1500  DRAW 0,0
 1510  MOVE 128,0
 1520  DRAW 0,128
 1530
 1540  VDU 5
 1550  MOVE 64,480
 1560  PRINT "Test printout"
 1570ENDPROC
 1580

� > Example1

5� demonstrate a simple use of the printer drivers
(� by Ben Summers
2
<
F
Poș "PDriver_Info" � type%, x_resolution%, y_resolution%, features%, name$, halftone_x_res%, halftone_y_res%
Z
d� 0
n
x!� "Test printout using "name$
��
�9� "Press any key to see what we're going to print..."
�	G = �
��
�
�� draw a white page
�,ș "ColourTrans_SetGCOL",&FFFFFF00,,,0,0
�ȓȐ 0,0,1024,1280
�
��draw_rectangle
�
��4
�(� "Press any key to print it out..."
	G = �

�
"
,� "Printing page"
6
@
JH� ******************************************************************
T
^'� claim some useful areas of memory
h+� rectangle% 16, transform% 16, plot% 8
r� to_draw% 16
|
�
�H� ******************************************************************
�
�� start off the print job
�
�title$ = "Test print job"
�
�this_job% = �("printer:")
�8ș "PDriver_SelectJob", this_job%, title$ � old_job%
�
�J� ș "PDriver_AbortJob",this_job%: �#this_job%: � �$ " at line " �: �
�
�H� ******************************************************************

.� declare all the fonts we're going to use
 � which is none in this case
&%ș "PDriver_DeclareFont", 0, 0, 0
0
:
DH� ******************************************************************
N
X� set up a rectangle
b
llow_x% = -2
vlow_y% = -2
�high_x% = 514
�high_y% = 514
�x_scale = 1
�y_scale = 1
�J� position of the bottom left hand corner is an inch in and an inch up
�2� from the bottom left hand corner of the page
�pos_x% = 72000
�pos_y% = 72000
�
�J� an arbitary, but carefully chosen, number to identify this rectangle
�id% = 42
�
�1� background colour of the rectangle is white
col% = &FFFFFF00

rectangle%!0  = low_x%
 rectangle%!4  = low_y%
*rectangle%!8  = high_x%
4rectangle%!12 = high_y%
>"transform%!0  = x_scale * 2^16
Htransform%!4  = 0
Rtransform%!8  = 0
\"transform%!12 = y_scale * 2^16
fplot%!0 = pos_x%
pplot%!4 = pos_y%
zHș "PDriver_GiveRectangle", id%, rectangle%, transform%, plot%, col%
�
�
�H� ******************************************************************
�
�/� right then, let's start the print job off
�
�copies% = 1
�
� � page number is unimportant
�
page% = 0
�
�Eș "PDriver_DrawPage", copies%, to_draw%, page%, 0 � more%, , id%
�

H� ******************************************************************

$9� draw the lovely rectangle as many times as required
.
8ȕ(more% <> 0)
B  �(id% = 42) �
L    �draw_rectangle
V  �
`
j:  ș "PDriver_GetRectangle", , to_draw% � more%, , id%
t�
~
�
�H� ******************************************************************
�
�)� ... and finally, end this print job
�
�"ș "PDriver_EndJob", this_job%
�'ș "PDriver_SelectJob", old_job%, 0
�
��# this_job%
�
�
�H� ******************************************************************


3� bye, bye. See you in the next example program

� "Finished"
(
2�
<
F
PH� ******************************************************************
Z
dD� procedure to draw the rectangle... note that it's the same one
n+� which draws the picture on the screen
x
���draw_rectangle
�  � set the colour to black
�.  ș "ColourTrans_SetGCOL",&00000000,,,0,0
�
�  � draw a simple shape
�  � 0,0
�
  � 0,512
�  � 512,512
�
  � 512,0
�  � 0,0
�
  � 128,0
�
  � 0,128
�
	  � 5
  � 64,480
  � "Test printout"
"�
,
�
00000000  0d 00 0a 10 f4 20 3e 20  45 78 61 6d 70 6c 65 31  |..... > Example1|
00000010  0d 00 14 04 0d 00 1e 35  f4 20 64 65 6d 6f 6e 73  |.......5. demons|
00000020  74 72 61 74 65 20 61 20  73 69 6d 70 6c 65 20 75  |trate a simple u|
00000030  73 65 20 6f 66 20 74 68  65 20 70 72 69 6e 74 65  |se of the printe|
00000040  72 20 64 72 69 76 65 72  73 0d 00 28 14 f4 20 62  |r drivers..(.. b|
00000050  79 20 42 65 6e 20 53 75  6d 6d 65 72 73 0d 00 32  |y Ben Summers..2|
00000060  04 0d 00 3c 04 0d 00 46  04 0d 00 50 6f c8 99 20  |...<...F...Po.. |
00000070  22 50 44 72 69 76 65 72  5f 49 6e 66 6f 22 20 b8  |"PDriver_Info" .|
00000080  20 74 79 70 65 25 2c 20  78 5f 72 65 73 6f 6c 75  | type%, x_resolu|
00000090  74 69 6f 6e 25 2c 20 79  5f 72 65 73 6f 6c 75 74  |tion%, y_resolut|
000000a0  69 6f 6e 25 2c 20 66 65  61 74 75 72 65 73 25 2c  |ion%, features%,|
000000b0  20 6e 61 6d 65 24 2c 20  68 61 6c 66 74 6f 6e 65  | name$, halftone|
000000c0  5f 78 5f 72 65 73 25 2c  20 68 61 6c 66 74 6f 6e  |_x_res%, halfton|
000000d0  65 5f 79 5f 72 65 73 25  0d 00 5a 04 0d 00 64 07  |e_y_res%..Z...d.|
000000e0  eb 20 30 0d 00 6e 04 0d  00 78 21 f1 20 22 54 65  |. 0..n...x!. "Te|
000000f0  73 74 20 70 72 69 6e 74  6f 75 74 20 75 73 69 6e  |st printout usin|
00000100  67 20 22 6e 61 6d 65 24  0d 00 82 05 f1 0d 00 8c  |g "name$........|
00000110  39 f1 20 22 50 72 65 73  73 20 61 6e 79 20 6b 65  |9. "Press any ke|
00000120  79 20 74 6f 20 73 65 65  20 77 68 61 74 20 77 65  |y to see what we|
00000130  27 72 65 20 67 6f 69 6e  67 20 74 6f 20 70 72 69  |'re going to pri|
00000140  6e 74 2e 2e 2e 22 0d 00  96 09 47 20 3d 20 a5 0d  |nt..."....G = ..|
00000150  00 a0 05 db 0d 00 aa 04  0d 00 b4 17 f4 20 64 72  |............. dr|
00000160  61 77 20 61 20 77 68 69  74 65 20 70 61 67 65 0d  |aw a white page.|
00000170  00 be 2c c8 99 20 22 43  6f 6c 6f 75 72 54 72 61  |..,.. "ColourTra|
00000180  6e 73 5f 53 65 74 47 43  4f 4c 22 2c 26 46 46 46  |ns_SetGCOL",&FFF|
00000190  46 46 46 30 30 2c 2c 2c  30 2c 30 0d 00 c8 16 c8  |FFF00,,,0,0.....|
000001a0  93 c8 90 20 30 2c 30 2c  31 30 32 34 2c 31 32 38  |... 0,0,1024,128|
000001b0  30 0d 00 d2 04 0d 00 dc  13 f2 64 72 61 77 5f 72  |0.........draw_r|
000001c0  65 63 74 61 6e 67 6c 65  0d 00 e6 04 0d 00 f0 06  |ectangle........|
000001d0  ef 34 0d 00 fa 28 f1 20  22 50 72 65 73 73 20 61  |.4...(. "Press a|
000001e0  6e 79 20 6b 65 79 20 74  6f 20 70 72 69 6e 74 20  |ny key to print |
000001f0  69 74 20 6f 75 74 2e 2e  2e 22 0d 01 04 09 47 20  |it out..."....G |
00000200  3d 20 a5 0d 01 0e 04 0d  01 18 05 db 0d 01 22 04  |= ............".|
00000210  0d 01 2c 15 f1 20 22 50  72 69 6e 74 69 6e 67 20  |..,.. "Printing |
00000220  70 61 67 65 22 0d 01 36  04 0d 01 40 04 0d 01 4a  |page"..6...@...J|
00000230  48 f4 20 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |H. *************|
00000240  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000270  2a 2a 2a 2a 2a 0d 01 54  04 0d 01 5e 27 f4 20 63  |*****..T...^'. c|
00000280  6c 61 69 6d 20 73 6f 6d  65 20 75 73 65 66 75 6c  |laim some useful|
00000290  20 61 72 65 61 73 20 6f  66 20 6d 65 6d 6f 72 79  | areas of memory|
000002a0  0d 01 68 2b de 20 72 65  63 74 61 6e 67 6c 65 25  |..h+. rectangle%|
000002b0  20 31 36 2c 20 74 72 61  6e 73 66 6f 72 6d 25 20  | 16, transform% |
000002c0  31 36 2c 20 70 6c 6f 74  25 20 38 0d 01 72 11 de  |16, plot% 8..r..|
000002d0  20 74 6f 5f 64 72 61 77  25 20 31 36 0d 01 7c 04  | to_draw% 16..|.|
000002e0  0d 01 86 04 0d 01 90 48  f4 20 2a 2a 2a 2a 2a 2a  |.......H. ******|
000002f0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000320  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 0d 01 9a 04  |************....|
00000330  0d 01 a4 1d f4 20 73 74  61 72 74 20 6f 66 66 20  |..... start off |
00000340  74 68 65 20 70 72 69 6e  74 20 6a 6f 62 0d 01 ae  |the print job...|
00000350  04 0d 01 b8 1d 74 69 74  6c 65 24 20 3d 20 22 54  |.....title$ = "T|
00000360  65 73 74 20 70 72 69 6e  74 20 6a 6f 62 22 0d 01  |est print job"..|
00000370  c2 04 0d 01 cc 1d 74 68  69 73 5f 6a 6f 62 25 20  |......this_job% |
00000380  3d 20 ae 28 22 70 72 69  6e 74 65 72 3a 22 29 0d  |= .("printer:").|
00000390  01 d6 38 c8 99 20 22 50  44 72 69 76 65 72 5f 53  |..8.. "PDriver_S|
000003a0  65 6c 65 63 74 4a 6f 62  22 2c 20 74 68 69 73 5f  |electJob", this_|
000003b0  6a 6f 62 25 2c 20 74 69  74 6c 65 24 20 b8 20 6f  |job%, title$ . o|
000003c0  6c 64 5f 6a 6f 62 25 0d  01 e0 04 0d 01 ea 4a ee  |ld_job%.......J.|
000003d0  85 20 c8 99 20 22 50 44  72 69 76 65 72 5f 41 62  |. .. "PDriver_Ab|
000003e0  6f 72 74 4a 6f 62 22 2c  74 68 69 73 5f 6a 6f 62  |ortJob",this_job|
000003f0  25 3a 20 d9 23 74 68 69  73 5f 6a 6f 62 25 3a 20  |%: .#this_job%: |
00000400  f1 20 f6 24 20 22 20 61  74 20 6c 69 6e 65 20 22  |. .$ " at line "|
00000410  20 9e 3a 20 e0 0d 01 f4  04 0d 01 fe 48 f4 20 2a  | .: ........H. *|
00000420  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000460  2a 0d 02 08 04 0d 02 12  2e f4 20 64 65 63 6c 61  |*......... decla|
00000470  72 65 20 61 6c 6c 20 74  68 65 20 66 6f 6e 74 73  |re all the fonts|
00000480  20 77 65 27 72 65 20 67  6f 69 6e 67 20 74 6f 20  | we're going to |
00000490  75 73 65 0d 02 1c 20 f4  20 77 68 69 63 68 20 69  |use... . which i|
000004a0  73 20 6e 6f 6e 65 20 69  6e 20 74 68 69 73 20 63  |s none in this c|
000004b0  61 73 65 0d 02 26 25 c8  99 20 22 50 44 72 69 76  |ase..&%.. "PDriv|
000004c0  65 72 5f 44 65 63 6c 61  72 65 46 6f 6e 74 22 2c  |er_DeclareFont",|
000004d0  20 30 2c 20 30 2c 20 30  0d 02 30 04 0d 02 3a 04  | 0, 0, 0..0...:.|
000004e0  0d 02 44 48 f4 20 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |..DH. **********|
000004f0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000520  2a 2a 2a 2a 2a 2a 2a 2a  0d 02 4e 04 0d 02 58 18  |********..N...X.|
00000530  f4 20 73 65 74 20 75 70  20 61 20 72 65 63 74 61  |. set up a recta|
00000540  6e 67 6c 65 0d 02 62 04  0d 02 6c 0f 6c 6f 77 5f  |ngle..b...l.low_|
00000550  78 25 20 3d 20 2d 32 0d  02 76 0f 6c 6f 77 5f 79  |x% = -2..v.low_y|
00000560  25 20 3d 20 2d 32 0d 02  80 11 68 69 67 68 5f 78  |% = -2....high_x|
00000570  25 20 3d 20 35 31 34 0d  02 8a 11 68 69 67 68 5f  |% = 514....high_|
00000580  79 25 20 3d 20 35 31 34  0d 02 94 0f 78 5f 73 63  |y% = 514....x_sc|
00000590  61 6c 65 20 3d 20 31 0d  02 9e 0f 79 5f 73 63 61  |ale = 1....y_sca|
000005a0  6c 65 20 3d 20 31 0d 02  a8 4a f4 20 70 6f 73 69  |le = 1...J. posi|
000005b0  74 69 6f 6e 20 6f 66 20  74 68 65 20 62 6f 74 74  |tion of the bott|
000005c0  6f 6d 20 6c 65 66 74 20  68 61 6e 64 20 63 6f 72  |om left hand cor|
000005d0  6e 65 72 20 69 73 20 61  6e 20 69 6e 63 68 20 69  |ner is an inch i|
000005e0  6e 20 61 6e 64 20 61 6e  20 69 6e 63 68 20 75 70  |n and an inch up|
000005f0  0d 02 b2 32 f4 20 66 72  6f 6d 20 74 68 65 20 62  |...2. from the b|
00000600  6f 74 74 6f 6d 20 6c 65  66 74 20 68 61 6e 64 20  |ottom left hand |
00000610  63 6f 72 6e 65 72 20 6f  66 20 74 68 65 20 70 61  |corner of the pa|
00000620  67 65 0d 02 bc 12 70 6f  73 5f 78 25 20 3d 20 37  |ge....pos_x% = 7|
00000630  32 30 30 30 0d 02 c6 12  70 6f 73 5f 79 25 20 3d  |2000....pos_y% =|
00000640  20 37 32 30 30 30 0d 02  d0 04 0d 02 da 4a f4 20  | 72000.......J. |
00000650  61 6e 20 61 72 62 69 74  61 72 79 2c 20 62 75 74  |an arbitary, but|
00000660  20 63 61 72 65 66 75 6c  6c 79 20 63 68 6f 73 65  | carefully chose|
00000670  6e 2c 20 6e 75 6d 62 65  72 20 74 6f 20 69 64 65  |n, number to ide|
00000680  6e 74 69 66 79 20 74 68  69 73 20 72 65 63 74 61  |ntify this recta|
00000690  6e 67 6c 65 0d 02 e4 0c  69 64 25 20 3d 20 34 32  |ngle....id% = 42|
000006a0  0d 02 ee 04 0d 02 f8 31  f4 20 62 61 63 6b 67 72  |.......1. backgr|
000006b0  6f 75 6e 64 20 63 6f 6c  6f 75 72 20 6f 66 20 74  |ound colour of t|
000006c0  68 65 20 72 65 63 74 61  6e 67 6c 65 20 69 73 20  |he rectangle is |
000006d0  77 68 69 74 65 0d 03 02  14 63 6f 6c 25 20 3d 20  |white....col% = |
000006e0  26 46 46 46 46 46 46 30  30 0d 03 0c 04 0d 03 16  |&FFFFFF00.......|
000006f0  1a 72 65 63 74 61 6e 67  6c 65 25 21 30 20 20 3d  |.rectangle%!0  =|
00000700  20 6c 6f 77 5f 78 25 0d  03 20 1a 72 65 63 74 61  | low_x%.. .recta|
00000710  6e 67 6c 65 25 21 34 20  20 3d 20 6c 6f 77 5f 79  |ngle%!4  = low_y|
00000720  25 0d 03 2a 1b 72 65 63  74 61 6e 67 6c 65 25 21  |%..*.rectangle%!|
00000730  38 20 20 3d 20 68 69 67  68 5f 78 25 0d 03 34 1b  |8  = high_x%..4.|
00000740  72 65 63 74 61 6e 67 6c  65 25 21 31 32 20 3d 20  |rectangle%!12 = |
00000750  68 69 67 68 5f 79 25 0d  03 3e 22 74 72 61 6e 73  |high_y%..>"trans|
00000760  66 6f 72 6d 25 21 30 20  20 3d 20 78 5f 73 63 61  |form%!0  = x_sca|
00000770  6c 65 20 2a 20 32 5e 31  36 0d 03 48 15 74 72 61  |le * 2^16..H.tra|
00000780  6e 73 66 6f 72 6d 25 21  34 20 20 3d 20 30 0d 03  |nsform%!4  = 0..|
00000790  52 15 74 72 61 6e 73 66  6f 72 6d 25 21 38 20 20  |R.transform%!8  |
000007a0  3d 20 30 0d 03 5c 22 74  72 61 6e 73 66 6f 72 6d  |= 0..\"transform|
000007b0  25 21 31 32 20 3d 20 79  5f 73 63 61 6c 65 20 2a  |%!12 = y_scale *|
000007c0  20 32 5e 31 36 0d 03 66  14 70 6c 6f 74 25 21 30  | 2^16..f.plot%!0|
000007d0  20 3d 20 70 6f 73 5f 78  25 0d 03 70 14 70 6c 6f  | = pos_x%..p.plo|
000007e0  74 25 21 34 20 3d 20 70  6f 73 5f 79 25 0d 03 7a  |t%!4 = pos_y%..z|
000007f0  48 c8 99 20 22 50 44 72  69 76 65 72 5f 47 69 76  |H.. "PDriver_Giv|
00000800  65 52 65 63 74 61 6e 67  6c 65 22 2c 20 69 64 25  |eRectangle", id%|
00000810  2c 20 72 65 63 74 61 6e  67 6c 65 25 2c 20 74 72  |, rectangle%, tr|
00000820  61 6e 73 66 6f 72 6d 25  2c 20 70 6c 6f 74 25 2c  |ansform%, plot%,|
00000830  20 63 6f 6c 25 0d 03 84  04 0d 03 8e 04 0d 03 98  | col%...........|
00000840  48 f4 20 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |H. *************|
00000850  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000880  2a 2a 2a 2a 2a 0d 03 a2  04 0d 03 ac 2f f4 20 72  |*****......./. r|
00000890  69 67 68 74 20 74 68 65  6e 2c 20 6c 65 74 27 73  |ight then, let's|
000008a0  20 73 74 61 72 74 20 74  68 65 20 70 72 69 6e 74  | start the print|
000008b0  20 6a 6f 62 20 6f 66 66  0d 03 b6 04 0d 03 c0 0f  | job off........|
000008c0  63 6f 70 69 65 73 25 20  3d 20 31 0d 03 ca 04 0d  |copies% = 1.....|
000008d0  03 d4 20 f4 20 70 61 67  65 20 6e 75 6d 62 65 72  |.. . page number|
000008e0  20 69 73 20 75 6e 69 6d  70 6f 72 74 61 6e 74 0d  | is unimportant.|
000008f0  03 de 0d 70 61 67 65 25  20 3d 20 30 0d 03 e8 04  |...page% = 0....|
00000900  0d 03 f2 45 c8 99 20 22  50 44 72 69 76 65 72 5f  |...E.. "PDriver_|
00000910  44 72 61 77 50 61 67 65  22 2c 20 63 6f 70 69 65  |DrawPage", copie|
00000920  73 25 2c 20 74 6f 5f 64  72 61 77 25 2c 20 70 61  |s%, to_draw%, pa|
00000930  67 65 25 2c 20 30 20 b8  20 6d 6f 72 65 25 2c 20  |ge%, 0 . more%, |
00000940  2c 20 69 64 25 0d 03 fc  04 0d 04 06 04 0d 04 10  |, id%...........|
00000950  48 f4 20 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |H. *************|
00000960  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000990  2a 2a 2a 2a 2a 0d 04 1a  04 0d 04 24 39 f4 20 64  |*****......$9. d|
000009a0  72 61 77 20 74 68 65 20  6c 6f 76 65 6c 79 20 72  |raw the lovely r|
000009b0  65 63 74 61 6e 67 6c 65  20 61 73 20 6d 61 6e 79  |ectangle as many|
000009c0  20 74 69 6d 65 73 20 61  73 20 72 65 71 75 69 72  | times as requir|
000009d0  65 64 0d 04 2e 04 0d 04  38 12 c8 95 28 6d 6f 72  |ed......8...(mor|
000009e0  65 25 20 3c 3e 20 30 29  0d 04 42 13 20 20 e7 28  |e% <> 0)..B.  .(|
000009f0  69 64 25 20 3d 20 34 32  29 20 8c 0d 04 4c 17 20  |id% = 42) ...L. |
00000a00  20 20 20 f2 64 72 61 77  5f 72 65 63 74 61 6e 67  |   .draw_rectang|
00000a10  6c 65 0d 04 56 07 20 20  cd 0d 04 60 04 0d 04 6a  |le..V.  ...`...j|
00000a20  3a 20 20 c8 99 20 22 50  44 72 69 76 65 72 5f 47  |:  .. "PDriver_G|
00000a30  65 74 52 65 63 74 61 6e  67 6c 65 22 2c 20 2c 20  |etRectangle", , |
00000a40  74 6f 5f 64 72 61 77 25  20 b8 20 6d 6f 72 65 25  |to_draw% . more%|
00000a50  2c 20 2c 20 69 64 25 0d  04 74 05 ce 0d 04 7e 04  |, , id%..t....~.|
00000a60  0d 04 88 04 0d 04 92 48  f4 20 2a 2a 2a 2a 2a 2a  |.......H. ******|
00000a70  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000aa0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 0d 04 9c 04  |************....|
00000ab0  0d 04 a6 29 f4 20 2e 2e  2e 20 61 6e 64 20 66 69  |...). ... and fi|
00000ac0  6e 61 6c 6c 79 2c 20 65  6e 64 20 74 68 69 73 20  |nally, end this |
00000ad0  70 72 69 6e 74 20 6a 6f  62 0d 04 b0 04 0d 04 ba  |print job.......|
00000ae0  22 c8 99 20 22 50 44 72  69 76 65 72 5f 45 6e 64  |".. "PDriver_End|
00000af0  4a 6f 62 22 2c 20 74 68  69 73 5f 6a 6f 62 25 0d  |Job", this_job%.|
00000b00  04 c4 27 c8 99 20 22 50  44 72 69 76 65 72 5f 53  |..'.. "PDriver_S|
00000b10  65 6c 65 63 74 4a 6f 62  22 2c 20 6f 6c 64 5f 6a  |electJob", old_j|
00000b20  6f 62 25 2c 20 30 0d 04  ce 04 0d 04 d8 10 d9 23  |ob%, 0.........#|
00000b30  20 74 68 69 73 5f 6a 6f  62 25 0d 04 e2 04 0d 04  | this_job%......|
00000b40  ec 04 0d 04 f6 48 f4 20  2a 2a 2a 2a 2a 2a 2a 2a  |.....H. ********|
00000b50  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000b80  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 0d 05 00 04 0d 05  |**********......|
00000b90  0a 33 f4 20 62 79 65 2c  20 62 79 65 2e 20 53 65  |.3. bye, bye. Se|
00000ba0  65 20 79 6f 75 20 69 6e  20 74 68 65 20 6e 65 78  |e you in the nex|
00000bb0  74 20 65 78 61 6d 70 6c  65 20 70 72 6f 67 72 61  |t example progra|
00000bc0  6d 0d 05 14 04 0d 05 1e  10 f1 20 22 46 69 6e 69  |m......... "Fini|
00000bd0  73 68 65 64 22 0d 05 28  04 0d 05 32 05 e0 0d 05  |shed"..(...2....|
00000be0  3c 04 0d 05 46 04 0d 05  50 48 f4 20 2a 2a 2a 2a  |<...F...PH. ****|
00000bf0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000c20  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 0d 05  |**************..|
00000c30  5a 04 0d 05 64 44 f4 20  70 72 6f 63 65 64 75 72  |Z...dD. procedur|
00000c40  65 20 74 6f 20 64 72 61  77 20 74 68 65 20 72 65  |e to draw the re|
00000c50  63 74 61 6e 67 6c 65 2e  2e 2e 20 6e 6f 74 65 20  |ctangle... note |
00000c60  74 68 61 74 20 69 74 27  73 20 74 68 65 20 73 61  |that it's the sa|
00000c70  6d 65 20 6f 6e 65 0d 05  6e 2b f4 20 77 68 69 63  |me one..n+. whic|
00000c80  68 20 64 72 61 77 73 20  74 68 65 20 70 69 63 74  |h draws the pict|
00000c90  75 72 65 20 6f 6e 20 74  68 65 20 73 63 72 65 65  |ure on the scree|
00000ca0  6e 0d 05 78 04 0d 05 82  14 dd f2 64 72 61 77 5f  |n..x.......draw_|
00000cb0  72 65 63 74 61 6e 67 6c  65 0d 05 8c 1f 20 20 f4  |rectangle....  .|
00000cc0  20 73 65 74 20 74 68 65  20 63 6f 6c 6f 75 72 20  | set the colour |
00000cd0  74 6f 20 62 6c 61 63 6b  0d 05 96 2e 20 20 c8 99  |to black....  ..|
00000ce0  20 22 43 6f 6c 6f 75 72  54 72 61 6e 73 5f 53 65  | "ColourTrans_Se|
00000cf0  74 47 43 4f 4c 22 2c 26  30 30 30 30 30 30 30 30  |tGCOL",&00000000|
00000d00  2c 2c 2c 30 2c 30 0d 05  a0 04 0d 05 aa 1b 20 20  |,,,0,0........  |
00000d10  f4 20 64 72 61 77 20 61  20 73 69 6d 70 6c 65 20  |. draw a simple |
00000d20  73 68 61 70 65 0d 05 b4  0b 20 20 ec 20 30 2c 30  |shape....  . 0,0|
00000d30  0d 05 be 0d 20 20 df 20  30 2c 35 31 32 0d 05 c8  |....  . 0,512...|
00000d40  0f 20 20 df 20 35 31 32  2c 35 31 32 0d 05 d2 0d  |.  . 512,512....|
00000d50  20 20 df 20 35 31 32 2c  30 0d 05 dc 0b 20 20 df  |  . 512,0....  .|
00000d60  20 30 2c 30 0d 05 e6 0d  20 20 ec 20 31 32 38 2c  | 0,0....  . 128,|
00000d70  30 0d 05 f0 0d 20 20 df  20 30 2c 31 32 38 0d 05  |0....  . 0,128..|
00000d80  fa 04 0d 06 04 09 20 20  ef 20 35 0d 06 0e 0e 20  |......  . 5.... |
00000d90  20 ec 20 36 34 2c 34 38  30 0d 06 18 17 20 20 f1  | . 64,480....  .|
00000da0  20 22 54 65 73 74 20 70  72 69 6e 74 6f 75 74 22  | "Test printout"|
00000db0  0d 06 22 05 e1 0d 06 2c  04 0d ff                 |.."....,...|
00000dbb