;+ ; ; @file_comments ; compatibility with old keywords ; if needed, force the definition of new keywords with the old ones. ; ; @categories compatibility with previous version ; ; @examples ; IDL> \@updatekwd ; (must be insert as an include in a procedure or function) ; ; @restrictions the compatibility can be made only if the keyword ; given through _extra are given with their complete name ; ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) ; July 2005 ; @version $Id$ ; ;- ; ; if ex is a structure... IF size(ex, /type) EQ 8 THEN BEGIN ; ; list of the old and new keywords ; old = ['dummy'] & new = ['dummy'] old = [old, 'boite'] & new = [new, 'boxzoom'] old = [old, 'carte'] & new = [new, 'realcont'] old = [old, 'cont_thick'] & new = [new, 'coast_thick'] old = [old, 'def_key_periodique'] & new = [new, 'periodic'] old = [old, 'grille'] & new = [new, 'gridtype'] old = [old, 'hzsurht'] & new = [new, 'zratio'] old = [old, 'nocouleur'] & new = [new, 'nofill'] old = [old, 'petit'] & new = [new, 'small'] old = [old, 'petitdessin'] & new = [new, 'small'] old = [old, 'ysurx'] & new = [new, 'yxaspect'] old = [old, 'discret'] & new = [new, 'discrete'] ; old = [old, ''] & new = [new, ''] ; supress the first dummy argument and make sure we use low case old = strtrim(strlowcase(old[1:*]), 2) new = strtrim(strlowcase(new[1:*]), 2) ; ; what are the keywords of the present routine? ; ; in which routine are we??? help, calls = rname rname = rname[0] rname = strmid(rname, 0, strpos(rname, ' ')) ; is this routine a function? fctlist = routine_info(/functions) dummy = where(fctlist EQ rname, count) ; keywords of the present routine kwds = routine_info(rname, /parameters, functions = count) IF kwds.num_kw_args NE 0 THEN BEGIN kwds = strlowcase(kwds.kw_args) ; ; for all tags of ex structure ; if one of them is included in the old list and if its new version ; is among the keywords of the current routine then force the definition ; of the new keyword with the old one. ; alltags = strlowcase(tag_names(ex)) FOR i = 0, n_elements(alltags)-1 DO BEGIN isold = (where(old EQ alltags[i], count))[0] IF count EQ 1 THEN BEGIN dummy = where(kwds EQ new[isold], count) IF count EQ 1 THEN BEGIN dummy = execute(new[isold] + ' = ex.' + alltags[i]) ; dummy = execute('ex = get_extra(' + new[isold] + ' = ex.' $ ; + alltags[i] + ', _extra = ex)') ENDIF ENDIF ENDFOR ENDIF ; ENDIF