;+ ; List the header information using the first !g.acount values of ; !g.astack as index numbers and using the appropriate input io ; object. ; ; If !g.line is true, then this uses !g.lineio, otherwise this uses ; !g.contio. ; ; @param start {in}{optional}{type=long} If set, the beginning of range to list ; @param finish {in}{optional}{type=long} If set, the end of range to list ; ; @keyword keep {in}{optional}{type=boolean} If set, the list comes from ; the keep file and !g.line is irrelevant. ; ; @version $Id: liststack.pro,v 1.4 2005/05/26 15:53:13 paghots Exp $ ;- PRO liststack, start, finish, keep=keep, _EXTRA=ex compile_opt idl2 ; initialize start, finish params if n_elements(start) eq 0 and n_elements(finish) eq 0 then begin range = 0 endif else begin range = 1 if start lt 0 then start = 0 ; start must have been defined if n_elements(finish) eq 0 then begin ; finish was not defined, but start was endat = !g.acount-1 endif else begin endat = finish ge !g.acount ? (!g.acount-1) : finish endelse if start gt endat then start = endat endelse if (!g.acount gt 0) then begin if (keyword_set(keep)) then begin if !g.lineoutio->is_data_loaded() eq 0 then begin message,'No keep file has been set or the keep file is empty',/info return endif if range then begin !g.lineoutio->list,index=(*!g.astack)[start:endat],_EXTRA=ex endif else begin !g.lineoutio->list,index=(*!g.astack)[0:(!g.acount)-1],_EXTRA=ex endelse endif else begin if (!g.line) then begin if !g.lineio->is_data_loaded() eq 0 then begin message,'No line input file has been set or the file is empty',/info return endif if range then begin !g.lineio->list,index=(*!g.astack)[start:endat],_EXTRA=ex endif else begin !g.lineio->list,index=(*!g.astack)[0:(!g.acount)-1],_EXTRA=ex endelse endif else begin if !g.contio->is_data_loaded() eq 0 then begin message,'No continuum input file has been set or the file is empty',/info return endif if range then begin !g.contio->list,index=(*!g.astack)[start:endat],_EXTRA=ex endif else begin !g.contio->list,index=(*!g.astack)[0:(!g.acount)-1],_EXTRA=ex endelse endelse endelse endif END