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

Last change on this file since 268 was 238, checked in by pinsard, 17 years ago

improvements/corrections of some *.pro headers

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
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
10; utilities
11;
12; @restrictions
13; compatible with \@<pro>ps</pro>
14; \@<pro>vzoom</pro> text_box...
15;
16; @history
17; Sebastien Masson (smasson\@lodyc.jussieu.fr)
18;
19; @version
20; $Id$
21;
22; @todo
23; seb
24;
25;-
26;
27;------------------------------------------------------------
28; Close the journal!
29;------------------------------------------------------------
30 journal
31; we recuperate the journal as a vector of string:
32   vectjournal = getfile(myuniquetmpdir+'idlsave.pro')
33; we cut the last line which is oups
34   vectjournal = vectjournal[0:n_elements(vectjournal)-2 ]
35;------------------------------------------------------------
36; we correct it if there is the need...
37;------------------------------------------------------------
38for i = 0, n_elements(vectjournal)-1 do $
39 if strpos(vectjournal[i],'text_box' ) EQ -1 then $
40 vectjournal[i] = strtrim(strcompress(vectjournal[i]), 2)
41;2 line are identical ??
42for i = 0, n_elements(vectjournal)-2 do $
43 if vectjournal[i] EQ vectjournal[i+1] then vectjournal[i] = ' '
44
45for i = 0, n_elements(vectjournal)-1 do BEGIN & $
46 if strpos(vectjournal[i],'oups' ) NE -1 $
47 OR strpos(vectjournal[i],'Syntax error' ) NE -1 $
48 OR strpos(vectjournal[i],'Illegal character' ) NE -1 $
49 then BEGIN vectjournal[i] = ' ' & vectjournal[i-1] = ' ' & endif & $
50 if strpos(strtrim(vectjournal[i], 1),'retall' ) EQ 0 $
51 OR strpos(vectjournal[i],'@oups' ) NE -1 $
52 OR strpos(vectjournal[i],'@ps' ) NE -1 $
53 OR strpos(vectjournal[i],'@vzoom' ) NE -1 $
54 OR strpos(vectjournal[i],'help' ) NE -1 $
55 OR strpos(vectjournal[i],'print' ) NE -1 $
56 then  vectjournal[i] = ' ' & $
57 if strpos(vectjournal[i],'text_box' ) NE -1 then $
58 vectjournal[i] = vectjournal[i]+strmid(vectjournal[i+1], 1) & endfor
59
60
61;
62; we erase the last line to reexecute all the programm but the last order.
63;
64 IF strpos(vectjournal[n_elements(vectjournal)-1],';,pos=[' ) NE -1 then $
65 vectjournal[n_elements(vectjournal)-2] = '' $
66 ELSE vectjournal[n_elements(vectjournal)-1] = ''
67; we rewrite idlsave.pro
68 putfile, myuniquetmpdir+'idlsave.pro', vectjournal
69; update the list of .pro and .sav in !PATH
70 path_cache, /rebuild
71; apply idlsave
72@idlsave
73; the journal has just been reopened, and we put elements of vectjournal in it.
74for i = 0, n_elements(vectjournal)-1 DO $
75journal, vectjournal[i]
76
77
78
Note: See TracBrowser for help on using the repository browser.