Please enable JavaScript to view this site.

A-Shell Reference

Elements can be deleted by iterating to them and then assigning .NULL to the element using the .REF($$i) function, as in the following example which deletes the element whose value is "something."

foreach $$i in $m()

    if $$i = "something" then

        $m(.REF($$i)) = .NULL   ! delete the element

        exit                    ! always exit foreach loop

    endif                       ! after removing an element, as it

next $$i                        ! may invalidate the iterator

 

In addition, you can use the following dot-statements to delete:

.POPFRONT $m()                  ! delete first element

.POPBACK $m()                   ! delete last element

 

Note that deleting an element will also delete any sublist attached to it.

See Also

Sublist Operations for details on deleting sublists