source: trunk/WIDGET/AUTOUR_de_XXX/inserthistory.pro @ 2

Last change on this file since 2 was 2, checked in by opalod, 22 years ago

Initial revision

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.0 KB
Line 
1PRO inserthistory,  base, text, line1, line2
2;-------------------------------------------------------------
3   widget_control,base, get_uvalue = top_uvalue
4   globalcommand = extractatt(top_uvalue, 'globalcommand')
5   *top_uvalue[1, findline(top_uvalue, 'globaloldcommand')] = globalcommand
6;   for i = 0, n_elements(globalcommand)-1 do print, globalcommand[i]
7; we insert text between line1 and line2
8    index1 = where(globalcommand EQ line1) & index1 = index1[0]+1
9    if index1  EQ -1 then begin
10       rien = report(line1+' n''est pas trouve ds globalcommand')
11       return
12    endif
13    index2 = where(globalcommand EQ line2) & index2 = index2[0]
14    if index2  EQ -1 then begin
15       rien = report(line2+' n''est pas trouve ds globalcommand')
16       return
17    ENDIF
18; the new text:
19    globalcommand = [globalcommand[0:index1], text, globalcommand[index2:n_elements(globalcommand)-1]]
20; the new globalcommand
21   *top_uvalue[1, findline(top_uvalue, 'globalcommand')] = globalcommand
22
23;-------------------------------------------------------------
24   return
25end
Note: See TracBrowser for help on using the repository browser.