source: trunk/SRC/ForOldVersion/updatekwd.pro @ 378

Last change on this file since 378 was 371, checked in by pinsard, 16 years ago

improvements of headers (alignments of IDL prompt in examples)

  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1;+
2;
3; @file_comments
4; For internal use of SAXO
5; compatibility with old keywords
6; if needed, force the definition of new keywords with the old ones.
7;
8; @categories
9; Compatibility
10;
11; @examples
12;
13; must be insert as an include in a procedure or function
14;
15;   IDL> @updatekwd
16;
17; @restrictions
18; the compatibility can be made only if the keywords
19; given through _extra are given with their complete name
20;
21; @history
22; Sebastien Masson (smasson\@lodyc.jussieu.fr)
23;                      July 2005
24; @version
25; $Id$
26;
27; @todo
28;
29;-
30; if ex is a structure...
31IF size(ex, /type) EQ 8 THEN BEGIN
32;
33; list of the old and new keywords
34;
35  old = ['dummy'] & new = ['dummy']
36  old = [old, 'boite']              & new = [new, 'boxzoom']
37  old = [old, 'carte']              & new = [new, 'realcont']
38  old = [old, 'cont_thick']         & new = [new, 'coast_thick']
39  old = [old, 'def_key_periodique'] & new = [new, 'periodic']
40  old = [old, 'grille']             & new = [new, 'gridtype']
41  old = [old, 'hzsurht']            & new = [new, 'zratio']
42  old = [old, 'nocouleur']          & new = [new, 'nofill']
43  old = [old, 'petit']              & new = [new, 'small']
44  old = [old, 'petitdessin']        & new = [new, 'small']
45  old = [old, 'ysurx']              & new = [new, 'yxaspect']
46  old = [old, 'discret']            & new = [new, 'discrete']
47;  old = [old, ''] & new = [new, '']
48; supress the first dummy argument and make sure we use low case
49  old = strtrim(strlowcase(old[1:*]), 2)
50  new = strtrim(strlowcase(new[1:*]), 2)
51;
52; what are the keywords of the present routine?
53;
54; in which routine are we???
55  help, calls = rname
56  rname = rname[0]
57  rname = strmid(rname, 0, strpos(rname, ' '))
58; is this routine a function?
59  fctlist = routine_info(/functions)
60  dummy = where(fctlist EQ rname, count)
61; keywords of the present routine
62  kwds = routine_info(rname, /parameters, functions = count)
63  IF kwds.num_kw_args NE 0 THEN BEGIN
64    kwds = strlowcase(kwds.kw_args)
65;
66; for all tags of ex structure
67; if one of them is included in the old list and if its new version
68; is among the keywords of the current routine then force the definition
69; of the new keyword with the old one.
70;
71    alltags = strlowcase(tag_names(ex))
72    FOR i = 0, n_elements(alltags)-1 DO BEGIN
73      isold = (where(old EQ alltags[i], count))[0]
74      IF count EQ 1 THEN BEGIN
75        dummy = where(kwds EQ new[isold], count)
76        IF count EQ 1 THEN BEGIN
77          dummy = execute(new[isold] + ' = ex.' + alltags[i])
78;           dummy = execute('ex = get_extra(' + new[isold] + ' = ex.' $
79;                           + alltags[i] + ', _extra = ex)')
80        ENDIF
81      ENDIF
82    ENDFOR
83  ENDIF
84;
85ENDIF
Note: See TracBrowser for help on using the repository browser.