Call Sherpa commands from S-Lang
Integer_Type sherpa_eval(String_Type)
The sherpa_eval() function allows S-Lang code to execute Sherpa commands.
To do this, you create a string which contains the command to execute
and pass it to sherpa_eval(), which returns a 0 on success and a -1 on failure.
In CIAO 3.0 there are a large number of commands that have equivalent
S-Lang functions, so the need for this function has been reduced.
() = sherpa_eval("method powell");
Here we change the method setting of Sherpa
to "powell" from within a S-Lang script
(the Sherpa module must have already been
imported using 'require("sherpa");').
We use "() = " to ignore the return value of the
call (i.e. whether it succeeded or not).
|