source: trunk/SRC/ToBeReviewed/POSTSCRIPT/ps.pro @ 232

Last change on this file since 232 was 232, 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: 3.9 KB
Line 
1;+
2; @file_comments
3; Redirect the content of the graphic window in a postscript,
4; by redoing commands in the postscript's environment.
5;
6; @categories
7; utilities
8;
9; @restrictions
10; We use journal which allows to stock commands we pass.
11;
12; @restrictions
13; Can break down if some weird commands are passed...
14; Comment: we erase Syntax error, Illegal characters, compatible
15; with oups, text_box...
16;
17; @history
18; Sebastien Masson (smasson\@lodyc.jussieu.fr)
19;                       5/3/1999
20;-
21;------------------------------------------------------------
22; We have to close the journal!
23;------------------------------------------------------------
24   if !journal EQ 0 then print, 'ERROR: The Journal is not open !!'
25journal
26;------------------------------------------------------------
27; we complete the journal ...
28;------------------------------------------------------------
29; We recuperate the journal as a vector of string :
30vectjournal = getfile(myuniquetmpdir+'idlsave.pro')
31; FOR i = 0,n_elements(vectjournal)-1 DO  print, vectjournal[i]
32;------------------------------------------------------------
33; We cut the last line which is \@ps
34;------------------------------------------------------------
35IF strpos(vectjournal[n_elements(vectjournal)-1],'@ps') ne -1 then $
36  vectjournal = vectjournal[0:n_elements(vectjournal)-2 ]
37;------------------------------------------------------------
38; We correct it if needed...
39;------------------------------------------------------------
40for i = 0, n_elements(vectjournal)-1 do $
41 if strpos(vectjournal[i],'text_box' ) EQ -1 then $
42 vectjournal[i] = strtrim(strcompress(vectjournal[i]), 2)
43; FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i]
44; if 2 lines are identical...
45for i = 0, n_elements(vectjournal)-2 do $
46 if vectjournal[i] EQ vectjournal[i+1] then vectjournal[i] = ' '
47; FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i]
48;
49for i = 0, n_elements(vectjournal)-1 do BEGIN & $
50 if strpos(vectjournal[i],'oups' ) NE -1 $
51 OR strpos(vectjournal[i],'Syntax error' ) NE -1 $
52 OR strpos(vectjournal[i],'Illegal character' ) NE -1 $
53 then BEGIN vectjournal[i] = ' ' & vectjournal[i-1] = ' ' & endif & endfor
54; FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i]
55for i = 0, n_elements(vectjournal)-1 do BEGIN & $
56 if strpos(strtrim(vectjournal[i], 1),'retall' ) EQ 0 $
57 OR strpos(vectjournal[i],'@ps' ) NE -1 $
58 OR strpos(vectjournal[i],'@oups' ) NE -1 $
59 OR strpos(vectjournal[i],'@vzoom' ) NE -1 $
60 OR strpos(vectjournal[i],'help' ) NE -1 $
61 OR strpos(vectjournal[i],'print' ) NE -1 $
62 then  vectjournal[i] = ' ' & endfor
63; FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i]
64for i = 0, n_elements(vectjournal)-1 do BEGIN & $
65 if strpos(strtrim(vectjournal[i], 1),'plt' ) NE -1 THEN BEGIN & $
66 if strpos(strtrim(vectjournal[i], 1),'noerase') NE -1 then $
67 vectjournal[i] = chkeywd(vectjournal[i],'noerase',1) ELSE $
68 vectjournal[i] = vectjournal[i]+',/noerase' & $
69 ENDIF & endfor
70; FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i]
71for i = 0, n_elements(vectjournal)-1 do BEGIN & $
72 if strpos(vectjournal[i],'text_box' ) NE -1 then $
73 IF strpos(vectjournal[i],',pos=' ) EQ -1 then $
74 vectjournal[i] = vectjournal[i]+strmid(vectjournal[i+1], 1) & endfor
75
76; We complete it to transform it in a procedure equivalent to plein2dessin
77   vectjournal = ['openps, infowidget= infowidget' $
78                  , vectjournal $
79                  ,'closeps, infowidget= infowidget' $
80                  ,'printps' ]
81; FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i]
82; We rewrite idlsave.pro
83   putfile, myuniquetmpdir+'idlsave.pro', vectjournal
84; update the list of .pro and .sav in !PATH
85   path_cache, /rebuild
86; apply idlsave
87@idlsave   
88; We reopen the journal and we put in it all elements of vectjournal but the 2 first and the 3 last line.
89journal, myuniquetmpdir+'idlsave.pro'
90for i = 2, n_elements(vectjournal)-3 DO $
91printf,  !journal, vectjournal[i]
92
93;------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.