IDLVM and execute [message #79045] |
Fri, 20 January 2012 12:36 |
TonyLanz
Messages: 4 Registered: January 2012
|
Junior Member |
|
|
Hi all,
I realize this has been asked on the group before. I'm hoping someone
might have a "simple" workaround in IDLVM to what would be easily
accomplished using the execute function in IDL proper. I have a widget
program that contains a compound widget field that allows the user to
define an equation for manipulating a set of four variables. For the
sake of argument let's say var1, var2, var3, and var4. In this
compound widget field they can define what math they want to do,
they're restricted to addition, subtraction, multiplication and
division.
so they could for example enter
var1/var2
or
var1-var2*0.2
or
var1+var2+var3
etc., you get the idea. Now in IDL I can just get the value from the
widget and simply do something like
s='result='+cwidget_value(0)
status=execute(s)
print,result
of course in IDLVM I'm not allowed to use EXECUTE()
Anyone have any suggestions for implementing this simply? I know in
the past there was discussion of writing code to break down the string
and pass the pieces to the right operators or functions (using
call_function() ) to assemble the result.
Tony
|
|
|