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

Last change on this file since 318 was 318, checked in by smasson, 16 years ago

header cleaning

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