1 | PRO inserthistory, base, text, line1, line2 |
---|
2 | ;------------------------------------------------------------- |
---|
3 | ; |
---|
4 | compile_opt idl2, strictarrsubs |
---|
5 | ; |
---|
6 | widget_control,base, get_uvalue = top_uvalue |
---|
7 | globalcommand = extractatt(top_uvalue, 'globalcommand') |
---|
8 | *top_uvalue[1, findline(top_uvalue, 'globaloldcommand')] = globalcommand |
---|
9 | ; for i = 0, n_elements(globalcommand)-1 do print, globalcommand[i] |
---|
10 | ; we insert text between line1 and line2 |
---|
11 | index1 = where(globalcommand EQ line1) & index1 = index1[0]+1 |
---|
12 | if index1 EQ -1 then begin |
---|
13 | rien = report(line1+' n''est pas trouve ds globalcommand') |
---|
14 | return |
---|
15 | endif |
---|
16 | index2 = where(globalcommand EQ line2) & index2 = index2[0] |
---|
17 | if index2 EQ -1 then begin |
---|
18 | rien = report(line2+' n''est pas trouve ds globalcommand') |
---|
19 | return |
---|
20 | ENDIF |
---|
21 | ; the new text: |
---|
22 | globalcommand = [globalcommand[0:index1], text, globalcommand[index2:n_elements(globalcommand)-1]] |
---|
23 | ; the new globalcommand |
---|
24 | *top_uvalue[1, findline(top_uvalue, 'globalcommand')] = globalcommand |
---|
25 | |
---|
26 | ;------------------------------------------------------------- |
---|
27 | return |
---|
28 | end |
---|