;+
; This procedure writes the data in the displayed spectrum to an ASCII
; file. See the documentation in dcascii
; for an explanation of the format of the output.
;
; @keyword brange {in}{optional}{type=integer}{default=0} The beginning
; of the range to be written, in units of the current plotter X-axis.
;
; @keyword erange {in}{optional}{type=integer}{default=0} The end
; of the range to be written, in units of the current plotter X-axis.
;
; @keyword filename {in}{optional}{type=string} The filename can be specified
; using this parameter. If omitted, the file will be called
; 'gbtidl.ascii'
;
; @keyword prompt {in}{optional}{type=boolean} When set, a file
; chooser dialogue is used to set the file name, even if filename was
; set as an argument.
;
; @examples
; write_ascii,filename='mydata.txt'
;
; @uses dcascii
;
; @version $Id: write_ascii.pro,v 1.6 2005/05/24 15:43:14 jbraatz Exp $
;-
pro write_ascii,brange=brange,erange=erange,filename=filename,prompt=prompt
common gbtplot_common,mystate,xarray
if n_elements(filename) eq 0 then filename='gbtidl.ascii'
if keyword_set(prompt) then filename = dialog_pickfile(file=filename,/write)
dcascii,file=filename,brange=brange,erange=erange
end