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

Last change on this file since 367 was 325, checked in by pinsard, 16 years ago

modification of some headers (+some corrections) to prepare usage of the new idldoc

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