Consultor Eletrônico



Kbase P111073: Is there a way to send printer control codes in a FORM or FRAME statement?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/21/2005
Status: Unverified

GOAL:

Is there a way to send printer control codes in a FORM or FRAME statement?

FIX:

Yes, if the session is using Windows Passthrough Printing (WPP) mode. Just define the printer control sequence as a character variable and place it in the desired position in the FRAME or FORM definition statement. For example the following code demonstrate how to put Compressed Mode Printing and Normal Mode Printing on a FORM. Please note that the actual value of the printer control sequences used in this example are not necessarily the same as on your printer. Check your printer documentation for the correct control sequences needed for the modes desired:
DEFINE VARIABLE NormalMode AS CHARACTER FORMAT "X(09)" INITIAL "~033(s10H".
DEFINE VARIABLE i AS INTEGER NO-UNDO.
OUTPUT TO PRINTER.
REPEAT FOR customer i = 1 TO 3:
FORM CompressedMode
name COLON 10
NormalMode
phone COLON 50
address COLON 10 salesrep COLON 50 SKIP
city COLON 10 NO-LABEL state NO-LABEL postalcode NO-LABEL
WITH SIDE-LABELS 1 DOWN CENTERED.
FIND NEXT customer.
DISPLAY name address city state postalcode phone salesrep.
END.
OUTPUT CLOSE.