This is probably a stupid question but how can I print the same number of lines with the same number of characters in diferent printers ?
I´ve tried this small program but it didn't work. I think I'm making a mistake whem computing the font parameters but I can't find any good example in the RM/COBOL manuals.
Can anyone give me any sugestion, or show me some examples for this kind of problem ?
Thanks in advance and please sorry my very bad english....
Vitor
FILE-CONTROL.
*
SELECT IMP ASSIGN TO PRINTER "PRINTER?".
*
DATA DIVISION.
FILE SECTION.
*
*
FD IMP LABEL RECORD OMITTED.
*
01 RI PIC X(150).
*
WORKING-STORAGE SECTION.
*
01 det1.
05 linha pic 99b.
05 texto pic x(147) value
"12345678901234567890123456789012345678901234567890
- "12345678901234567890123456789012345678901234567890
- "12345678901234567890123456789012345678901234567".
*
01 mod1 pic 9(03).
*
COPY PRINTDLG.
*
COPY LOGFONT.
*
COPY DEVCAPS.
*
/
PROCEDURE DIVISION.
A-INICIO.
OPEN OUTPUT IMP.
CALL "P$CLEARDIALOG".
CALL "P$SETDIALOG" USING PRINTDIALOG.
CALL "P$GetDeviceCapabilities" USING
DEVICECAPABILITIES.
COMPUTE LF-Height ROUNDED =
(DC-PhysicalHeight) / 80.
COMPUTE LF-Width ROUNDED =
(DC-PhysicalWidth) / 170.
CALL "P$ClearFont".
CALL "P$SetFont" USING
LF-FACENAMEPARAM, "COURIER NEW"
LF-HEIGHTPARAM, LF-Height
LF-WIDTHPARAM, LF-WIDTH.
move 1 to mod1 linha.
write ri from det1 after 0.
soma-mod1.
add 1 to mod1.
if mod1 < 80
move mod1 to linha
write ri from det1 after 1
go soma-mod1.
stop run.
I´ve tried this small program but it didn't work. I think I'm making a mistake whem computing the font parameters but I can't find any good example in the RM/COBOL manuals.
Can anyone give me any sugestion, or show me some examples for this kind of problem ?
Thanks in advance and please sorry my very bad english....
Vitor
FILE-CONTROL.
*
SELECT IMP ASSIGN TO PRINTER "PRINTER?".
*
DATA DIVISION.
FILE SECTION.
*
*
FD IMP LABEL RECORD OMITTED.
*
01 RI PIC X(150).
*
WORKING-STORAGE SECTION.
*
01 det1.
05 linha pic 99b.
05 texto pic x(147) value
"12345678901234567890123456789012345678901234567890
- "12345678901234567890123456789012345678901234567890
- "12345678901234567890123456789012345678901234567".
*
01 mod1 pic 9(03).
*
COPY PRINTDLG.
*
COPY LOGFONT.
*
COPY DEVCAPS.
*
/
PROCEDURE DIVISION.
A-INICIO.
OPEN OUTPUT IMP.
CALL "P$CLEARDIALOG".
CALL "P$SETDIALOG" USING PRINTDIALOG.
CALL "P$GetDeviceCapabilities" USING
DEVICECAPABILITIES.
COMPUTE LF-Height ROUNDED =
(DC-PhysicalHeight) / 80.
COMPUTE LF-Width ROUNDED =
(DC-PhysicalWidth) / 170.
CALL "P$ClearFont".
CALL "P$SetFont" USING
LF-FACENAMEPARAM, "COURIER NEW"
LF-HEIGHTPARAM, LF-Height
LF-WIDTHPARAM, LF-WIDTH.
move 1 to mod1 linha.
write ri from det1 after 0.
soma-mod1.
add 1 to mod1.
if mod1 < 80
move mod1 to linha
write ri from det1 after 1
go soma-mod1.
stop run.