errsetstring
errsetstring(t_string[g_errprint] [s_langMode] ) =>l_value/nil
Description
Reads and evaluates an expression stored in a string. Same as evalstring except that it calls errset to catch any errors that might occur during the parsing and evaluation.
If an error has occurred, nil is returned, otherwise a list containing the value of the evaluation is returned. Should an error occur, it is stored in errset.errset. If errprint is non-nil, error messages are printed out; otherwise they are suppressed.
Arguments
|
Flag for controlling the printout of error messages. If |
|
Value Returned
Examples
errsetstring("1+2")
=> (3)
errsetstring("1+'a")
=> nil
Returns nil because an error occurred.
errsetstring("1+'a" t)
=> nil
Prints out error message
=>*Error* plus: can't handle (1+a)...
Related Topics
Function and Program Structure
Return to top