source: trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/inserthistory.pro @ 150

Last change on this file since 150 was 150, checked in by navarro, 18 years ago

english and nicer header (3a)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.3 KB
Line 
1;+
2; @file_comments
3;
4;
5; @categories
6;
7;
8; @param BASE
9;
10;
11; @param TEXT
12;
13;
14; @param LINE1
15;
16;
17; @param LINE2
18;
19;
20; @returns
21;
22;
23; @uses
24;
25;
26; @restrictions
27;
28;
29; @examples
30;
31;
32; @history
33;
34;
35; @version
36; $Id$
37;
38; @todo
39; seb
40;
41;-
42;-------------------------------------------------------------
43PRO inserthistory,  base, text, line1, line2
44;
45  compile_opt idl2, strictarrsubs
46;
47   widget_control,base, get_uvalue = top_uvalue
48   globalcommand = extractatt(top_uvalue, 'globalcommand')
49   *top_uvalue[1, findline(top_uvalue, 'globaloldcommand')] = globalcommand
50;   for i = 0, n_elements(globalcommand)-1 do print, globalcommand[i]
51; we insert text between line1 and line2
52    index1 = where(globalcommand EQ line1) & index1 = index1[0]+1
53    if index1  EQ -1 then begin
54       rien = report(line1+' n''est pas trouve ds globalcommand')
55       return
56    endif
57    index2 = where(globalcommand EQ line2) & index2 = index2[0]
58    if index2  EQ -1 then begin
59       rien = report(line2+' n''est pas trouve ds globalcommand')
60       return
61    ENDIF
62; the new text:
63    globalcommand = [globalcommand[0:index1], text, globalcommand[index2:n_elements(globalcommand)-1]]
64; the new globalcommand
65    *top_uvalue[1, findline(top_uvalue, 'globalcommand')] = globalcommand
66
67;-------------------------------------------------------------
68   return
69end
Note: See TracBrowser for help on using the repository browser.