SLEN

Set accept length of window field and reposition

Source

 

CALL SLEN USING Length Offset

Parameters

Length

A PIC 9(2) C variable containing the new input length to be used for the field.

Offset

A PIC 9(2) C variable containing the no of characters to shift the field by. If offset is positive, the field is shifted to the right, if negative to the left.

Copybooks

None

 

Other Requirements

The field in question must be a PIC X type field.

The routine must be called from the B- or V- routine of the field being changed.

Purpose

This routine allows you to change the length of the current field within the active window. In addition you can move the position of the accept field to the left or right.

Exceptions

None

Example

77 Z-LENGTH	PIC 9(2) C	* Used to adjust length of input field
77 Z-OFFSET	PIC 9(2) C	* Used to adjust start position of field

WINDOW W1
EDT
01 01 "Account"
01 09 W1ACCOUNT X(8)

ROUTINES SECTION
B-W1ACCOUNT.
   MOVE 6 TO Z-LENGTH
   MOVE 2 TO Z-OFFSET
   CALL SLEN USING Z-LENGTH Z-OFFSET
EXIT

ENDWINDOW

The window now displays and accepts as if it had been compiled as a PIC X(6) field instead of a PIC X(8) field.

Global 3000 Example

An example of the use of this routine is CS580 (Project Ledger Prefix Maintenance). This program uses this routine (and the BLEN routine) to change the length and position of a number of fields within a window.