7 28 3 DLT_ENTRY Examples

LANSA Technical

7.28.3 DLT_ENTRY Examples

Example 1: Delete the 3rd entry from the order line working list, which is the first list defined in the program:

DEF_LIST   NAME(#ORDERLINE) FIELDS(#ORDLIN #PRODUCT #QUANTITY #PRICE) TYPE(*WORKING)
*    ... <entries added to the order line list via ADD_ENTRY>     
GET_ENTRY  NUMBER(3) FROM_LIST(#ORDERLINE)                   
DLT_ENTRY                                                    
 

which is equivalent to:

GET_ENTRY  NUMBER(3) FROM_LIST(#ORDERLINE)                   
DLT_ENTRY  NUMBER(*CURRENT) FROM_LIST(*FIRST)                
 

which is also equivalent to:

GET_ENTRY  NUMBER(3) FROM_LIST(#ORDERLINE)                   
DLT_ENTRY  NUMBER(*CURRENT) FROM_LIST(#ORDERLINE)            
 

which is also equivalent to:

DLT_ENTRY  NUMBER(3) FROM_LIST(#ORDERLINE)                   
 

Example 2: Delete all entries in an existing working list named #ORDERLINE, where the field #QUANTITY is less than or equal to 0:

DEF_LIST   NAME(#ORDERLINE) FIELDS(#ORDLIN #PRODUCT #QUANTITY #PRICE) TYPE(*WORKING)
DEFINE     FIELD(#ENTRY) TYPE(*DEC) LENGTH(7) DECIMALS(0)
 
SELECTLIST NAMED(#ORDERLINE)
IF         COND('#QUANTITY *LE 0')
DLT_ENTRY  NUMBER(*CURRENT) FROM_LIST(#ORDERLINE)
ENDIF
ENDSELECT