View Full Version : INFO overloading errors

03-23-2011, 02:51 PM
The INFO function seems to have some problems with the overloaded keywords. Most can be passed as undefined, but there are three that give errors. I would like to wrap this function and call any given keyword that is defined in the wrapper. Thus the overloading is not consistent. Can this be changed?

;<Expression> FLOAT = 3.14159

INFO, !PI, DEPTH=depth ; this works, as do all the other keywords, except:

INFO, !PI, LEVEL=level ; this errors
;%%%INFO: Variable is undefined: LEVEL.
;%%%Execution halted at $MAIN$ .

INFO, !PI, NAMES=names ; this errors
;%%%INFO: Variable is undefined: Conversion source variable.
;%%%Execution halted at $MAIN$ .

INFO, !PI, VARIABLES=variables ; this errors
;%%%INFO: String expression required in this context: <FLOAT (3.14159)>.
;%%%Execution halted at $MAIN$ .

03-24-2011, 10:56 AM
I'll file a CR for this. In the meantime, try wrapping it like this:

PRO wrap_info, v, names=names, level=level, variables=variables
str = 'info, ' + v
if param_present(names) then str= str + ', names=names'
if param_present(level) then str= str + ', level=level'
if param_present(variables) then str= str + ', variables=variables'