# Deleting MLIST Elements
> [HTML Version](deletingmlistelements.htm)
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](sublistoperations.htm.md) for details on deleting sublists