PRO inserthistory, base, text, line1, line2 ;------------------------------------------------------------- ; compile_opt idl2, strictarrsubs ; widget_control,base, get_uvalue = top_uvalue globalcommand = extractatt(top_uvalue, 'globalcommand') *top_uvalue[1, findline(top_uvalue, 'globaloldcommand')] = globalcommand ; for i = 0, n_elements(globalcommand)-1 do print, globalcommand[i] ; we insert text between line1 and line2 index1 = where(globalcommand EQ line1) & index1 = index1[0]+1 if index1 EQ -1 then begin rien = report(line1+' n''est pas trouve ds globalcommand') return endif index2 = where(globalcommand EQ line2) & index2 = index2[0] if index2 EQ -1 then begin rien = report(line2+' n''est pas trouve ds globalcommand') return ENDIF ; the new text: globalcommand = [globalcommand[0:index1], text, globalcommand[index2:n_elements(globalcommand)-1]] ; the new globalcommand *top_uvalue[1, findline(top_uvalue, 'globalcommand')] = globalcommand ;------------------------------------------------------------- return end