PRO CLOSEALL,LIST=list ;+ ;Procedure CLOSEALL closes all open windows. ; ; KEYWORDS ; Set the keyword /LIST to have a list of the indices ; of the windows printed to the screen. ;- ; W=[0] While !D.WINDOW GE 0 DO BEGIN W=[W,!D.WINDOW] WDELETE ENDWHILE IF KEYWORD_SET(list) THEN $ IF N_ELEMENTS(W) GT 1 THEN PRINT,"Closed Windows ",REVERSE(W[1:N_ELEMENTS(W)-1]) IF N_ELEMENTS(W) EQ 1 THEN PRINT,'No windows to close' END