


This operation code allows you to change the position of the printer's write cursor. This is useful when doing multiple write statements that include a variety of fonts, font sizes and font attributes.
Usage
CALL "WIN$PRINTER"
USING WINPRINT-SET-CURSOR, WINPRINT-DATA
GIVING RESULT
Parameters
WINPRINT-DATA Group item defined in "winprint.def" as follows:
01 WINPRINT-DATA.
03 WPRTDATA-SET-STD-FONT.
03 WPRTDATA-DRAW REDEFINES
WPRTDATA-SET-STD-FONT.
05 WPRTDATA-DRAW-START-X PIC 9(7)V99 COMP-5.
05 WPRTDATA-DRAW-START-Y PIC 9(7)V99 COMP-5.
05 WPRTDATA-DRAW-STOP-X PIC 9(7)V99 COMP-5.
05 WPRTDATA-DRAW-STOP-Y PIC 9(7)V99 COMP-5.
05 WPRTDATA-DRAW-UNITS UNSIGNED-SHORT.
05 WPRTDATA-DRAW-SHAPE UNSIGNED-SHORT.
Return Values
This option returns the horizontal and vertical coordinates of the write cursor. If an error is returned, the current cursor position is not affected.
Description
When printing in Windows, the position of text on the printed page is determined by the location of the write cursor. This is usually handled automatically by the runtime, but you may use this operation to position the cursor yourself.
The printer must be open to perform this operation. WPRTDATA-DRAW should be initialized prior to use. The current cursor position on the printer is modified by this call only if WPRTDATA-DRAW-SHAPE is set to a value of "0" and the operation is successful.
When the cursor is moved in this manner, subsequent WRITE statements will be affected. One exception is that the vertical position of subsequent calls to WINPRINT-COLUMNS will be altered, but not the horizontal position. If you use this operation with WPRDATA-DRAW-SHAPE set to a non-zero value, the cursor is not repositioned. This can be used to inquire the position of the write cursor without changing it. There is no limit to the number of times this operation may be called.
WINPRINT-SET-CURSOR has the following values:
WPRTDATA-DRAW-START-X - Specifies the X coordinate of the cursor location. The unit of measure is set with WPRTDATA-DRAW-UNITS. The minimum value of this coordinate is "0".
WPRTDATA-DRAW-START-Y - Specifies the Y coordinate of the cursor location. The unit of measure is set with WPRTDATA-DRAW-UNITS. The minimum value of this coordinate is "0". WPRTDATA-DRAW-STOP-X - Returns the lower-right horizontal coordinate of the cursor location. This parameter has no input value, the previous X coordinate is returned. The unit of measure is always pixels.WPRTDATA-DRAW-STOP-Y - Returns the lower-right vertical coordinate of the cursor location. This parameter has no input value, the previous Y coordinate is returned. The unit of measure is always pixels.
WPRTDATA-DRAW-UNITS - Specifies the unit of measure used for the values passed. If an illegal value is used, the default will be used (WPRTUNITS-PIXELS). The unit of measure may be set to one of the following values:
WPRTUNITS-CELLS – Values are measured using the "cell size" of the currently selected font. The cell-size is determined by the height and width of the "0" character of a font. This is roughly equivalent to measuring in characters.WPRTDATA-DRAW-SHAPE – Determines if subsequent WRITE statements will be affected. A value of "0" sets the position of the write cursor. A non zero value will simply return the coordinates of the current position of the write cursor. Return values are always given in pixels.