ADELIA |
VADELIA |
SADELIA |
WADELIA |
MADELIA |
(I/B) |
(I/B) (C/S) |
(B) (S) |
(I/B) (C/S) |
(I) (C/S) |
Warning: In the case of ADELIA programs, this instruction is not compatible with C generator.
Section for use
All
Syntax
INSERT_LST List1Name List2Name Position
Position |
→ |
*BEGIN | *END | *BEFORE | *AFTER |
|
|
| None |
Description
This instruction inserts the list List1Name into the list List2Name; the two lists must be made up of fields with the same definition (same type, same length and same number of decimal places).
The insertion position Position indicates the point at which the new elements are to be inserted. A summary is given in the table below:
*BEGIN |
At the beginning of the list |
*END |
At the end of the list |
*BEFORE |
Immediately before the current position |
*AFTER |
Immediately after the current position |
The position parameter is optional; the default setting is *AFTER.
Once this instruction has been executed, the last element inserted becomes the current element of List2Name. The current element of List1Name is the last element.
If the list to be inserted is empty, the current element remains unchanged.
If the operation has completed normally, &CODE_LST returns *NORMAL.
The table below shows the various possible results:
List status |
Result |
List empty |
OK |
After a deletion |
*BEFORE = *AFTER, *END and *BEGIN: OK |
After the end of the list |
*BEFORE = *AFTER = *END, *BEGIN: OK |
Before the beginning of the list |
*BEFORE = *AFTER = *BEGIN, *END: OK |
Current element defined |
OK |
Example
INSERT_LST List List2
INSERT_LST List List2 *BEGIN
INSERT_LST List List2 *END
INSERT_LST List List2 *BEFORE
INSERT_LST List List2 *AFTER