source: trunk/SRC/ToBeReviewed/UTILITAIRE/oups.pro @ 133

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

english and nicer header (1)

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1;+
2;
3; @file_comments
4;       Kind of UNDO:
5;         Allows to redo all the chain of drawing since the opening of the last window without
6;         reexecute the last order Example: I do a drawing with 10 plot over it, if I make a
7;         mistake, I execute this program and i can redo the only plot missed.
8;
9; @categories utilities
10;
11; @restrictions compatible with @ps @vzoom text_box...
12;
13; @history Sebastien Masson (smasson@lodyc.jussieu.fr)
14;
15;
16; @version $Id$
17;
18; @todo seb
19;
20;-
21;------------------------------------------------------------
22; Close the journal!
23;------------------------------------------------------------
24 journal
25; we recuperate the journal as a vector of string:
26   vectjournal = getfile(myuniquetmpdir+'idlsave.pro')
27; we cut the last line which is oups
28   vectjournal = vectjournal[0:n_elements(vectjournal)-2 ]
29;------------------------------------------------------------
30; we correct it if there is the need...
31;------------------------------------------------------------
32for i = 0, n_elements(vectjournal)-1 do $
33 if strpos(vectjournal[i],'text_box' ) EQ -1 then $
34 vectjournal[i] = strtrim(strcompress(vectjournal[i]), 2)
35;2 line are identical ??
36for i = 0, n_elements(vectjournal)-2 do $
37 if vectjournal[i] EQ vectjournal[i+1] then vectjournal[i] = ' '
38
39for i = 0, n_elements(vectjournal)-1 do BEGIN & $
40 if strpos(vectjournal[i],'oups' ) NE -1 $
41 OR strpos(vectjournal[i],'Syntax error' ) NE -1 $
42 OR strpos(vectjournal[i],'Illegal character' ) NE -1 $
43 then BEGIN vectjournal[i] = ' ' & vectjournal[i-1] = ' ' & endif & $
44 if strpos(strtrim(vectjournal[i], 1),'retall' ) EQ 0 $
45 OR strpos(vectjournal[i],'@oups' ) NE -1 $
46 OR strpos(vectjournal[i],'@ps' ) NE -1 $
47 OR strpos(vectjournal[i],'@vzoom' ) NE -1 $
48 OR strpos(vectjournal[i],'help' ) NE -1 $
49 OR strpos(vectjournal[i],'print' ) NE -1 $
50 then  vectjournal[i] = ' ' & $
51 if strpos(vectjournal[i],'text_box' ) NE -1 then $
52 vectjournal[i] = vectjournal[i]+strmid(vectjournal[i+1], 1) & endfor
53
54
55;
56; we erase the last line to reexecute all the programm but the last order.
57;
58 IF strpos(vectjournal[n_elements(vectjournal)-1],';,pos=[' ) NE -1 then $
59 vectjournal[n_elements(vectjournal)-2] = '' $
60 ELSE vectjournal[n_elements(vectjournal)-1] = ''
61; we rewrite idlsave.pro
62putfile, myuniquetmpdir+'idlsave.pro', vectjournal
63; we compile, then we apply idlsave
64cd,  current = curdir
65cd, myuniquetmpdir
66@idlsave   
67cd, curdir
68; the journal has just been reopened, and we put elements of vectjournal in it.
69for i = 0, n_elements(vectjournal)-1 DO $
70journal, vectjournal[i]
71     
72
73
Note: See TracBrowser for help on using the repository browser.