|
Warning: In the case of ADELIA programs, this instruction is not compatible with C generator.
All
INSERT_ELT ListName Position Change
|
This instruction inserts a new element in the list ListName, using the values of its variables.
The insertion position Position indicates the point at which the new element is to be inserted. A summary is given in the table below:
|
The position parameter is optional; the default setting is *END.
With sorted insertions, you must define the fields to be used for sorting. By default, all the fields are included. You can specify the *ASC (ascending) or *DESC (descending) instruction for the fields set to be sorted. Where the order is not specified, the default setting is "ascending".
Click here for the explanation of the SortOption element.
The parameter Change sets the status of the inserted element to "Changed".
Warning: *MODIF cannot be used with ADELIA programs.
Once this instruction has been run, the inserted element becomes the current element. If the operation has completed normally, &CODE_LST returns *NORMAL.
The table below shows the various possible results:
|
INSERT_ELT List
INSERT_ELT InvoiceList *BEGIN
INSERT_ELT CustomertList *BEGIN *CHANGE
INSERT_ELT ItemList *END
INSERT_ELT List *BEFORE
INSERT_ELT AgreementList *AFTER
INSERT_ELT CustomerList *SORT(CUST_ID *ASC)
* This section permits to insert item codes into a list ITEM_LST
LOADING_LST ITEM_LOADING
ITEM_LST:CURRENT_VALUE = IITEM_COD
INSERT_ELT ITEM_LST:LIST
END_LOADING_LST