Winprint-set-cursor is not returning the current cursor position.

0 Likes

Problem:

The print file is opened to do some write statements to print part of the report then use this code to get the write-cursor's current position:

           INITIALIZE WPRTDATA-DRAW.

           MOVE WPRTUNITS-PIXELS TO WPRTDATA-DRAW-UNITS.           

           MOVE 1 TO WPRTDATA-DRAW-SHAPE.

           CALL "WIN$PRINTER" USING

                 WINPRINT-SET -CURSOR,

                 WINPRINT-DAT A

                  GIVING CALL-RESULT.

The documentation says a non-zero value (in this case a 1) in wprtdata-draw-shape simply inquires the current cursor position and will return the X and Y coordinates.  

However when checking WPRTDATA-DRAW-START-X and WPRTDATA-DRAW-START-Y there values are always zero.

Resolution:

The winprint-set-cursor operation uses these data items, defined in winprint.def:

01 WINPRINT-DATA.

   03 WPRTDATA-SET-STD-FONT.

   03 WPRTDATA-DRAW REDEFINES WPRTDATA-SET-STD-FONT.

      05  WPRTDATA-DRAW-START-X       P IC 9(7)V99 COMP-5.

      05  WPRTDATA-DRAW-START-Y       P IC 9(7)V99 COMP-5.

      05  WPRTDATA-DRAW-STOP-X       &n bsp;PIC 9(7)V99 COMP-5.

      05  WPRTDATA-DRAW-STOP-Y       &n bsp;PIC 9(7)V99 COMP-5.

      05  WPRTDATA-DRAW-UNITS       &nb sp; UNSIGNED-SHORT.

      05  WPRTDATA-DRAW-SHAPE       &nb sp; UNSIGNED-SHORT.

After the call to get the cursor position the X and Y values are stored in WPRTDATA-DRAW-STOP-X and WPRTDATA-DRAW-STOP-Y, not in the ...START-X and START-Y items.

Old KB# 2699
Comment List
Related
Recommended