;+ ; Remove an index or array of indicies from the stack. ; ; @param indx {in}{required}{type=integer} The stack entries to be removed. ; ; @examples ;
;   addstack, 10,30,2
;   delete, [16,18,20]
;   tellstack
; 
; ; @version $Id: delete.pro,v 1.5 2005/05/24 20:00:43 jbraatz Exp $ ;- PRO delete, indx compile_opt idl2 if (!g.acount gt 0) then begin allStack = (*!g.astack)[0:(!g.acount-1)] toBeRemoved = lonarr(!g.acount) for i=0,(n_elements(indx)-1) do begin foundIndx = where(allStack eq indx[i], count) if (count gt 0) then begin toBeRemoved[foundIndx] = -1 endif endfor toBeKept = where(toBeRemoved ne -1, count) if (count gt 0) then begin if (count ne !g.acount) then begin !g.acount = count (*!g.astack)[0:(!g.acount-1)] = allStack[toBeKept] endif endif else begin !g.acount = 0 endelse endif END