Please enable JavaScript to view this site.

 

void = List_Delete(sListVarName, nIndex)

 

This macro function is used to remove the nIndex-th entry of a list sListVarName.

 

IMPORTANT: do not confuse the functions List_Destroy and List_Delete.

 

•List_Destroy destroys (removes from memory) the entire list.

•List_Delete removes a single entry from a list.

 

Additionally, when calling List_Delete to remove an entry while iterating through a list, it is usually better to perform the iteration backward, so that the effects of deleting some of the list entries are behind you.

// iterate though the list backwards
for nList = List_Count(sListHolNames) to 1 step -1
   sCurString = List_GetString(sListHolNames, nList)
   if pos('*DELETE*', sCurString) > 0
      List_Delete(sListHolNames, nList)
   endif
endfor

Creation and Destruction of Lists

 

When using lists, don't forget to use the function List_Create to create your list at the top of the macro, and then the function List_Destroy to destroy it at the end of the macro.

 

See also: List_Add.

 


Topic 188535, last updated on 11-Oct-2026