PRTPAGE Example


Example 1:

 

P

PFILE

 

 

TITLE

INIT

"PRTPAGE Sample Output"

 

DATE

DIM

8

 

FORM1

FORM

"98.654"

 

*

 

 

 

.Allow the User to Select a Printer

.

 

 

 

  

PRTOPEN

P,"",""

 

*

 

 

 

.Print an Oval and Three Round Rectangles

.

 

 

 

  

CLOCK

DATE,DATE

 

.

 

 

 

  

PRTPAGE

P;*BGCOLOR=*YELLOW:

;Gray fill

  

  

*P50:1,TITLE:

;Output the Title

  

  

*P56:2,DATE:

; and the Date

  

  

*FILL=*ON:

;Set fill mode on

  

  

 

 

  

  

*OVAL=2:10:10:40:

;Print oval object

  

  

*FILL=*OFF:

;Set fill mode off

  

  

*PENSIZE=10:

;Change width of pen

  

  

*RNDRECT=12:20:10:40:1:1:

;Round rectangle

  

  

*RNDRECT=22:30:10:40:2:2:

;Round rectangle

  

  

*RNDRECT=32:40:10:40:3:3:

;Round rectangle

  

  

*BGCOLOR=*WHITE;

 

*

 

 

 

.Print a Filled Rectangle

.

 

 

 

  

PRTPAGE

P;*BGCOLOR=*YELLOW,*FILL=*ON:

 

  

  

*RECT=42:50:10:70,*OVERLAYON;

 

  

 

 

 

*

 

 

 

.Print a Field Using Each of the Alignment Properties

.

 

 

 

  

PRTPAGE

P;*P40:52,*ALIGNMENT=*RIGHT,"Line 1":

 

  

  

*P40:53,"Line 2 ABCDEF":

 

  

  

*P40:54,*ALIGNMENT=*LEFT,"Line 3":

 

  

  

*ALIGNMENT=*DECIMAL:

 

  

  

*P40:55,"12345.234":

 

  

  

*P40:56,"23.45",*P40:57,FORM1

 

*

 

 

 

.Close the Printer and Exit

.

 

 

 

  

PRTCLOSE

P

 

  

STOP

 

 

 

This example prints an oval, three round rectangles, a filled rectangle and aligned data to a user selected printer.

 

Example 2:

 

PF

PFILE

 

 

  

....

 

 

  

PRTOPEN

PF,"@?",""

 

  

....

 

 

  

PRTCLOSE

PF,ABORT

;Aborts print session

  

PRTCLOSE

PF,ABORT=1

;Aborts print session

  

PRTCLOSE

PF,ABORT=0

;Does not abort

  

PRTCLOSE

PF,ABORT=ABTFLG

;Optional ABORT

 

 



PL/B Language Reference PROFILE Example READ AFILE Examples