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

Last change on this file since 297 was 240, checked in by pinsard, 17 years ago

replace some print by some report in some .pro (continuation)

  • 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;-
32;
33PRO inserthistory,  base, text, line1, line2
34;
35  compile_opt idl2, strictarrsubs
36;
37   widget_control,base, get_uvalue = top_uvalue
38   globalcommand = extractatt(top_uvalue, 'globalcommand')
39   *top_uvalue[1, findline(top_uvalue, 'globaloldcommand')] = globalcommand
40;   for i = 0, n_elements(globalcommand)-1 do print, globalcommand[i]
41; we insert text between line1 and line2
42    index1 = where(globalcommand EQ line1) & index1 = index1[0]+1
43    if index1  EQ -1 then begin
44       rien = report(line1+' not found in globalcommand')
45       return
46    endif
47    index2 = where(globalcommand EQ line2) & index2 = index2[0]
48    if index2  EQ -1 then begin
49       rien = report(line2+' not found in globalcommand')
50       return
51    ENDIF
52; the new text:
53    globalcommand = [globalcommand[0:index1], text, globalcommand[index2:n_elements(globalcommand)-1]]
54; the new globalcommand
55    *top_uvalue[1, findline(top_uvalue, 'globalcommand')] = globalcommand
56
57;-------------------------------------------------------------
58   return
59end
Note: See TracBrowser for help on using the repository browser.