Hello there.
I am very new to programming so I will apologise in advance if I am being completely thick here.
I am writing a program to generate a postscript file to be sent to a printer. The postscript co-ordinates live in working storage so that text can be added and written to the output file.
The problem is that theer can be 3 sizes of print (A3/A4/A5), and therefore the postscript co-ordinates for each of these differ.
I was hoping (rather optimistically) to do this:
WORKING-STORAGE SECTION.
01 W100-LARGEPRICE-X.
03 W100-X-FILLER-1 PIC (21).
88 SIZE-IS-A3 VALUE '0 30 30 Z 200 160 m ('.
88 SIZE-IS-A4 VALUE '0 25 25 Z 190 158 m ('.
88 SIZE-IS-A5 VALUE '0 20 20 Z 180 156 m ('.
03 W-100-PRICE PIC 9.
03 W100-X-FILLER-2 PIC (21).
88 SIZE-IS-A3 VALUE ') 19 19 Z 210 160 m (P)'.
88 SIZE-IS-A4 VALUE ') 17 17 Z 200 158 m (P)'.
88 SIZE-IS-A5 VALUE ') 16 16 Z 190 156 m (P)'.
01 W110-LARGEPRICE-XX.
03 W110-X-FILLER-1 PIC x(17).
88 SIZE-IS-A3 VALUE 'more postscript...'.
88 SIZE-IS-A4 VALUE 'more postscript...'.
88 SIZE-IS-A5 VALUE 'more postscript...'.
03 W110-PRICE PIC 99.
03 W110-X-FILLER-2 PIC (17).
88 SIZE-IS-A3 VALUE 'more postscript...'.
88 SIZE-IS-A4 VALUE 'more postscript...'.
88 SIZE-IS-A5 VALUE 'more postscript...'.
........ more of the same .......
PROCEDURE DIVISON.
EVALUATE W200-USERS-CHOICE
WHEN 1
SET SIZE-IS-A3 TO TRUE
WHEN 2
SET SIZE-IS-A4 TO TRUE
WHEN OTHER
SET SIZE-IS-A5 TO TRUE
END-EVALUATE
I was hoping I could do this so I could set up the correct co-ordinates in one go. The compiler did not object to the declarations, but it objected to the SET TO TRUE as the 88 levels are not uniquely defined data names.
Is there any way round this, or does anyone have any better ideas..... I want to avoid:
1. Hard coding the postscript stuff in MOVE statements
2. Giving each 88 level a unique name as there are lots of them.
3. Having 3 seperate areas of working storage, one for each size.
Any help would be greatly appreciated.
Regards
I am very new to programming so I will apologise in advance if I am being completely thick here.
I am writing a program to generate a postscript file to be sent to a printer. The postscript co-ordinates live in working storage so that text can be added and written to the output file.
The problem is that theer can be 3 sizes of print (A3/A4/A5), and therefore the postscript co-ordinates for each of these differ.
I was hoping (rather optimistically) to do this:
WORKING-STORAGE SECTION.
01 W100-LARGEPRICE-X.
03 W100-X-FILLER-1 PIC (21).
88 SIZE-IS-A3 VALUE '0 30 30 Z 200 160 m ('.
88 SIZE-IS-A4 VALUE '0 25 25 Z 190 158 m ('.
88 SIZE-IS-A5 VALUE '0 20 20 Z 180 156 m ('.
03 W-100-PRICE PIC 9.
03 W100-X-FILLER-2 PIC (21).
88 SIZE-IS-A3 VALUE ') 19 19 Z 210 160 m (P)'.
88 SIZE-IS-A4 VALUE ') 17 17 Z 200 158 m (P)'.
88 SIZE-IS-A5 VALUE ') 16 16 Z 190 156 m (P)'.
01 W110-LARGEPRICE-XX.
03 W110-X-FILLER-1 PIC x(17).
88 SIZE-IS-A3 VALUE 'more postscript...'.
88 SIZE-IS-A4 VALUE 'more postscript...'.
88 SIZE-IS-A5 VALUE 'more postscript...'.
03 W110-PRICE PIC 99.
03 W110-X-FILLER-2 PIC (17).
88 SIZE-IS-A3 VALUE 'more postscript...'.
88 SIZE-IS-A4 VALUE 'more postscript...'.
88 SIZE-IS-A5 VALUE 'more postscript...'.
........ more of the same .......
PROCEDURE DIVISON.
EVALUATE W200-USERS-CHOICE
WHEN 1
SET SIZE-IS-A3 TO TRUE
WHEN 2
SET SIZE-IS-A4 TO TRUE
WHEN OTHER
SET SIZE-IS-A5 TO TRUE
END-EVALUATE
I was hoping I could do this so I could set up the correct co-ordinates in one go. The compiler did not object to the declarations, but it objected to the SET TO TRUE as the 88 levels are not uniquely defined data names.
Is there any way round this, or does anyone have any better ideas..... I want to avoid:
1. Hard coding the postscript stuff in MOVE statements
2. Giving each 88 level a unique name as there are lots of them.
3. Having 3 seperate areas of working storage, one for each size.
Any help would be greatly appreciated.
Regards