PRO Get_Names, namesList, SELECTION = selection

;+
; NAME: 
;	Get_Names
; PURPOSE:
;	To get the names of all the plots stored in plot table.
; CATEGORY:
;	Data Management
; CALLING SEQUENCE:
; 	Get_Names, namesList
; OUTPUT:
;	namesList: the names of the plots in the plot table.
; COMMON BLOCK:
;	Data, where the plot table is stored, opaque.
; -
;MODIFICATION HISTORY:
;	Created in June 1991 by A.Csillaghy

COMMON Data, plotList
 
IF NOT Keyword_Set(SELECTION) THEN BEGIN
  IF N_Elements(plotList) GT 1 THEN $
    namesList = plotList(1:(N_Elements(plotList)-1) < 300).name 
ENDIF ELSE BEGIN
  namesList = ''
  nbSel = N_Selected() < 300
  FOR i = 0,nbSel-1 DO namesList = [namesList,Selection(i)]
  namesList = namesList(1:nbSel)
ENDELSE

END