
PRO Remove_Sel, name

;+
; NAME:
;	Remove_Sel
; PURPOSE:
; 	Remove a plot from the selection
; CATEGORY:
;	Data Management
; CALLING SEQUENCE:
;	Remove_Sel, name
; INPUT:
; 	name: the name of the plot to be removed
; COMMON BLOCK:
;	SelectionRetrieval, opaque, where the selection list is
;		stored.
; SIDE EFFECT:
;	The selection list is changed
;-
; MODIFICATION HISTORY:
;	Created in May 1991 by A.Csillaghy

COMMON SelectionRetrieval, plotsSelected, dummy

nbEls = N_Elements( plotsSelected)
i = nbEls
WHILE (i GT 1) AND (plotsSelected(i-1) NE name) DO i = i-1 
IF plotsSelected(i-1) EQ name THEN $
    IF i EQ 1 THEN $
      plotsSelected = [plotsSelected(1:nbEls-1)] $
    ELSE IF i LT nbEls THEN $
      plotsSelected = [ plotsSelected(0:i-2), plotsSelected(i:nbEls-1)] $
    ELSE $
      plotsSelected = [ plotsSelected(0:nbEls-2) ]


END