;+ ; Move the data from the from_index location to the to_index location. Anything in ; to_index is lost. This uses the value of !g.line. If it is set (1) ; then the array of line data (!g.s) is used, otherwise the array of ; continuum data (!g.c) is used. The contents of from_index are ; emptied and lost. ; ; @param from_index {in}{required}{type=integer} The index to move ; values from. ; ; @param to_index {in}{required}{type=integer} The index to move the ; values to. ; ; @examples ; Move the contents of location 0 to location 10. Then move the ; contents of 9 to location 0. ;
; copy, 0, 10 ; copy, 9, 0 ;; ; @uses copy ; ; @version $Id: move.pro,v 1.5 2005/05/10 15:11:58 bgarwood Exp $ ;- PRO move, from_index, to_index compile_opt idl2 if n_params() ne 2 then begin message,'Usage: move, from_index, to_index',/info return endif ; argument checking happens in copy copy, from_index, to_index ; wipe out contents of from_index if (!g.line) then begin data_free, !g.s[from_index] !g.s[from_index] = data_new() endif else begin data_free, !g.c[from_index] !g.c[from_index] = data_new(/continuum) endelse return END