WINPRINT-GET-MARGINS

This operation code may be used with WINPRINT-SETUP-USE-MARGINS to obtain the margins set in the Windows printer setup dialog box or the margins set with WINPRINT-SET-MARGINS.

If used with WINPRINT-SETUP-USE-MARGINS, it returns information about the current default margin in the Windows printer setup dialog box using centimeters or inches but not with pixels or cells. This occurs because the operation code is used with WINPRINT-SETUP-USE-MARGINS and can therefore be used only with values supported by the dialog box.

If you have used WINPRINT-SET-MARGINS and later call WINPRINT-GET-MARGINS, the values returned are those originally set with WINRPRINT-SET-MARGINS, which may include inches, centimeters, pixels, or cells.

Usage

INITIALIZE WPRTDATA-MARGINS
CALL "WIN$PRINTER"
    USING WINPRINT-GET-MARGINS, 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-MARGINS REDEFINES
      WPRTDATA-SET-STD-FONT.
      05 WPRTDATA-TOP-MARGIN           PIC 9(7)V99 COMP-5.
      05 WPRTDATA-BOTTOM-MARGIN        PIC 9(7)V99 COMP-5.
      05 WPRTDATA-LEFT-MARGIN          PIC 9(7)V99 COMP-5.
      05 WPRTDATA-RIGHT-MARGIN         PIC 9(7)V99 COMP-5.
      05 WPRTDATA-MARGIN-UNITS         UNSIGNED-SHORT.

WINPRINT-GET-MARGINS requires the WPRTDATA-MARGINS structure to be passed as the second parameter and WPRTDATA-MARGINS is filled with the current margins defined as the defaults in the printer dialog box.

Return Values

This operation returns one of the following values:

  • WPRTMARGIN-CENTIMETERS
  • WPRTMARGIN-INCHES
  • WPRTMARGIN-PIXELS (only if set with WINPRINT-SET-MARGINS)
  • WPRTMARGIN-CELLS (only if set with WINPRINT-SET-MARGINS)