Modifying List Lines

To modify the lines of a completed list from within the program, use the MODIFY LINE statement. There are two ways to specify the line you want to modify:

Explicitly:

MODIFY LINE n [INDEX idx|OF CURRENT PAGE|OF PAGE p]               
[modifications]. 

You can refer to the line most recently read:

MODIFY CURRENT LINE [modifications].

This statement modifies the line most recently read by means of line selection (F2) or read by the READ LINE statement.

Apart from the ones described above, the modifications addition contains several other possibilities to modify the line. For more information on this and on the individual additions of the MODIFY LINE statement, refer to the keyword documentation.

Modifying Line Formatting

To modify the formatting of the line you want to change, use the LINEFORMAT addition of the MODIFY statement as follows:

MODIFY ... LINE FORMAT option 1 option 2 ... .

This statement sets the output format for the entire changed line according to the format specifications option1 option2 …. The possible format specifications correspond to those of the format statement FORMAT.

Modifying Field Contents

To explicitly modify the contents of fields in the line you want to change, use the FIELD VALUE addition of the MODIFY statement:

MODIFY ... FIELD VALUE f1 [FROM g1] f2 [FROM g2] ... .

This statement overwrites the contents of the fields f1 f2 ... in the list line with the current contents of the fields f1 f2 ... and g1 g2 .... If necessary, the system converts the field type to type c.

For more information, refer to the keyword documentation.

Modifying Field Formatting

To modify the formatting of fields in the line you want to change, use the FIELDFORMAT addition of the MODIFY statement as follows:

MODIFY ... FIELD FORMAT f1 options1 f2 options2 ... .

This statement sets the output format of the fields f1 f2 ... occurring in the line according to the format specified in options1 options2 .... You can specify formats from the FORMAT statement in options1 options2 ....

The option FIELDFORMAT overwrites, field by field, the specifications of the LINEFORMAT addition. If fields f1 f2 ... occur more than once in the line, the system modifies only the first field. If a field f1 f2 ... does not occur in the line at all, the system ignores the addition.

Examples