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

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

modification of some headers (+some corrections) to prepare usage of the new idldoc

  • Property svn:keywords set to Id
File size: 2.9 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; @todo
25; find the write way to comment this empty file for idldoc
26; to avoid those error messages
27; IDLDOC: unknown tag "file_comments" in file updatekwd.pro
28; IDLDOC: unknown tag "categories" in file updatekwd.pro
29; IDLDOC: unknown tag "restrictions" in file updatekwd.pro
30;
31;-
32; if ex is a structure...
33IF size(ex, /type) EQ 8 THEN BEGIN
34;
35; list of the old and new keywords
36;
37  old = ['dummy'] & new = ['dummy']
38  old = [old, 'boite']              & new = [new, 'boxzoom']
39  old = [old, 'carte']              & new = [new, 'realcont']
40  old = [old, 'cont_thick']         & new = [new, 'coast_thick']
41  old = [old, 'def_key_periodique'] & new = [new, 'periodic']
42  old = [old, 'grille']             & new = [new, 'gridtype']
43  old = [old, 'hzsurht']            & new = [new, 'zratio']
44  old = [old, 'nocouleur']          & new = [new, 'nofill']
45  old = [old, 'petit']              & new = [new, 'small']
46  old = [old, 'petitdessin']        & new = [new, 'small']
47  old = [old, 'ysurx']              & new = [new, 'yxaspect']
48  old = [old, 'discret']            & new = [new, 'discrete']
49;  old = [old, ''] & new = [new, '']
50; supress the first dummy argument and make sure we use low case
51  old = strtrim(strlowcase(old[1:*]), 2)
52  new = strtrim(strlowcase(new[1:*]), 2)
53;
54; what are the keywords of the present routine?
55;
56; in which routine are we???
57  help, calls = rname
58  rname = rname[0]
59  rname = strmid(rname, 0, strpos(rname, ' '))
60; is this routine a function?
61  fctlist = routine_info(/functions)
62  dummy = where(fctlist EQ rname, count)
63; keywords of the present routine
64  kwds = routine_info(rname, /parameters, functions = count)
65  IF kwds.num_kw_args NE 0 THEN BEGIN
66    kwds = strlowcase(kwds.kw_args)
67;
68; for all tags of ex structure
69; if one of them is included in the old list and if its new version
70; is among the keywords of the current routine then force the definition
71; of the new keyword with the old one.
72;
73    alltags = strlowcase(tag_names(ex))
74    FOR i = 0, n_elements(alltags)-1 DO BEGIN
75      isold = (where(old EQ alltags[i], count))[0]
76      IF count EQ 1 THEN BEGIN
77        dummy = where(kwds EQ new[isold], count)
78        IF count EQ 1 THEN BEGIN
79          dummy = execute(new[isold] + ' = ex.' + alltags[i])
80;           dummy = execute('ex = get_extra(' + new[isold] + ' = ex.' $
81;                           + alltags[i] + ', _extra = ex)')
82        ENDIF
83      ENDIF
84    ENDFOR
85  ENDIF
86;
87ENDIF
Note: See TracBrowser for help on using the repository browser.