Show TOC

Pre-Setting BOX Position ArgumentsLocate this document in the navigation structure

Procedure

You can use the POSITION and SIZE commands to preset some arguments in the BOX command. POSITION presets the starting point (upper left corner) of a box or line. SIZE specifies the width and height of a box.

You can use POSITION and SIZE to preset arguments, but you can also set the start point and size arguments of a box or line directly in the BOX command.

By default, if no positioning is specified, the upper left corner of a box or halftone or the top of a line is aligned with the current SAPscript window. That is, the upper left corner of the box, halftone, or line starts at the upper left corner of the current window in the active form. By default, the height and width of a box are set to the height and width of the current window.

Use POSITION and SIZE to preset the arguments in a BOX command in the following situations:

  • The BOX command is not allowed to exceed the 132-character (1 line in SAPscript) length limitation. If you specify all arguments directly in the command, this length limitation could be exceeded. This can be the case, for example, if you use symbols in the command.

    By pre-setting arguments with POSITION and SIZE, you can work around the limitation on the length of a command. You do not need to specify the preset arguments again in the BOX command.

  • You want to use the enhanced capabilities of POSITION for adjusting the starting point of a box or line.

    With BOX, you can specify an offset for the starting point only as a whole number (non-negative integer). This command would print a box starting 1 CM to the right and 1 CM down from the left upper corner of a window:

    /: BOX XPOS '1' CM YPOS '1' CM

    With POSITION, you can specify the position of a line or box in relation to the window with greater precision, since both positive and negative whole numbers and fractions are possible with this command.

    Example

    The following command causes a box to be output that is slightly above and to the left of the window. The result is a margin between the box and the text in the window.

    /: POSITION XORIGIN '-.2' CM YORIGIN '-.2' CM

    /: SIZE WIDTH '+.2' CM HEIGHT '+.2' CM

    /: BOX FRAME 10 TW

    (The size of the box has to be increased so that it fully encloses the window.)

    You can also use POSITION to set the starting point at the upper left corner of the active page format.

    POSITION PAGE moves the starting point from the active window to the active page format.

  • You want to use the SIZE functions for entering relative sizes in order to control the size of a box, a half-tone area, or a line.

    With BOX, you can make only absolute size specifications. Example: BOX HEIGHT overrides the default height setting and activates the height of the current window.

    With SIZE, you can adjust the size of a box or a line with respect to its previously-set dimensions.

    Example

    The following commands would, for example, draw a frame 1 CM in from the margins of the paper:

    /: POSITION PAGE

    /: POSITION XORIGIN 1 CM YORIGIN 1 CM

    /: SIZE PAGE

    /: SIZE HEIGHT '-2' CM WIDTH '-2' CM