;+
; List the displayed data container or a global data container in
; tabular form. See the documentation for
; dcascii for an explanation
; of the output. Use
; write_ascii to save this
; output to a file.
;
; @param index {in}{optional}{type=integer} The index of the data
; container to use. If not set, it uses the most recently displayed
; data as shown in the plotter.
;
; @keyword brange {in}{optional}{type=float}{default all} Beginning of
; the range to use, in units of the current plotter X-axis
;
; @keyword erange {in}{optional}{type=float}{default all} End of
; the range to use, in units of the current plotter X-axis
;
; @uses dcascii
;
; @version $Id: table.pro,v 1.2 2005/04/28 13:46:48 jbraatz Exp $
;-
pro table,index,brange=brange,erange=erange
if n_elements(index) eq 0 then begin
dcascii,brange=brange,erange=erange
endif else begin
if index lt 0 then begin
message,'index must be >= 0',/info
return
endif
if !g.line then begin
if index ge n_elements(!g.s) then begin
message,string(n_elements(!g.s),format='("index must be < ",i2)'),/info
return
endif
dcascii,!g.s[index],brange=brange,erange=erange
endif else begin
if index ge n_elements(!g.c) then begin
message,string(n_elements(!g.c),format='("index must be < ",i2)'),/info
return
endif
dcascii,!g.c[index],brange=brange,erange=erange
endelse
endelse
end