&SCOPED-DEFINE RESET_PRINTER {&CONTROL} "~033E".
&SCOPED-DEFINE STREAM PUT STREAM o_s
&SCOPED-DEFINE CONTROL {&STREAM} CONTROL
&SCOPED-DEFINE PRINTER_CONTROL PUT STREAM o_s CONTROL "~033(8U~033(s0p12h0s0b4099T". /* Courier Font - 12 Pitch */

DEF STREAM o_s.

DEF VAR w-col-pos       AS DEC          NO-UNDO.
DEF VAR w-row-pos       AS DEC          NO-UNDO. 
DEF VAR dfile           AS CHARACTER    FORMAT "X(20)".

DEF VAR lvMoveCursor        AS CHAR INIT "~033*p750y450X".  /*Vertical Cursor positioning command moves the cursor to the new position 
                                                            of 750 dots along the vertical axis.Horizontal cursor positioning command 
                                                            moves the cursor 450 dots along the horizontal axis. */

DEF VAR lvRectangleWidth    AS CHAR INIT "~033*c1500A".     /* Specifies a rectangle width of 1500 dots. */

DEF VAR lvRectangleHeight   AS CHAR INIT "~033*c1500B".     /* Specifies a rectangle height of 1500 dots. */

DEF VAR lvSolidBlack        AS CHAR INIT "~033*c0P".        /* Specifies Solid Black fill of the rectangle. */

DEF VAR lvTransparent       AS CHAR INIT "~033*v0N".        /* Specifies the characters and character cells as transparent so the black
                                                            background will appear behind the characters. */

DEF VAR lvOpaque            AS CHAR INIT "~033*v1O".        /* Specifies that the characters be printed in an opaque mode. */

DEF VAR lvCrossHatchPattern AS CHAR INIT "~033*c1G".        /* Specifies the cross-hatch pattern to be used in the characters. */

DEF VAR lvCrossHatchChar    AS CHAR INIT "~033*v3T".        /* Allows the character to be printed as cross hatch characters rather than
                                                            black characters. */
DEF VAR lvProportion        AS CHAR INIT "~033(s1p30v0s0b4101T". /* Specifies a proportionally spaced 30
                                                                point, upright, medium stroke weight, CG Times. */  
DEF VAR lvMoveCursorB       AS CHAR INIT "~033*p1500y713X". /* Specifies cursor positioning 1500 dots in
                                                            the vertical position and 713 dots in the horizontal position. */

DEF VAR lvText              AS CHAR INIT "This is some sample text". 
dfile = USERID(DBNAME) + "rpt.prn". 

OUTPUT STREAM o_s TO VALUE(dfile).

{&RESET_PRINTER}



    {&CONTROL} lvMoveCursor.
    {&CONTROL} lvRectangleWidth.
    {&CONTROL} lvRectangleHeight.
    {&CONTROL} lvSolidBlack.
    {&CONTROL} lvTransparent .
    {&CONTROL} lvOpaque.
    {&CONTROL} lvCrossHatchPattern.
    {&CONTROL} lvCrossHatchChar.
    {&CONTROL} lvProportion.
    {&CONTROL} lvMoveCursorB .
    DISPLAY STREAM o_s lvText.

{&RESET_PRINTER}

OUTPUT STREAM o_s CLOSE.
UNIX silent lp -dlwmis value(dfile). 
