Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

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

t_string

String to be evaluated.

g_errprint

Flag for controlling the printout of error messages. If t, then prints the error message encountered in errset. Defaults to nil.

s_langMode

Symbol to determine the language mode to use.

The valid values are:

  • 'ils, which indicates that the given string is evaluated in SKILL++ mode.
  • 'il, which indicates that the given string is evaluated in SKILL code. This is the default mode.

Value Returned

l_value

List with the value from successful evaluation of t_string.

nil

An error occurs.

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

error

evalstring


Return to top
 ⠀
X