;+ ; Clear the stack. ; ; Normally this simply sets !g.acount to 0, and this is all that is needed ; for typical use of the stack. ; Optionally, the procedure can also reset the stack array to zeros and it can shrink ; the size of the stack to its initial size of 5120 elements. ; ; @keyword reset {in}{optional}{type=boolean} When set, the values will be ; reset to 0. This is not required for typical use of the stack. ; ; @keyword shrink {in}{optional}{type=boolean} When set, the size of the ; array will be reset to its initial size of 5120 elements. This is to ; reverse any automatic expansion that may have occurred during previous ; stack operations. ; ; @version $Id: emptystack.pro,v 1.3 2005/05/24 20:16:56 jbraatz Exp $ ;- PRO emptystack, reset=reset, shrink=shrink compile_opt idl2 if (keyword_set(shrink)) then begin ptr_free, !g.astack !g.astack = ptr_new(lonarr(5120)) endif else begin if (keyword_set(reset) and !g.acount gt 0) then begin (*!g.astack)[0:(!g.acount-1)] = 0 endif endelse !g.acount = 0 END