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

loadstring

loadstring( 
t_string 
[ s_langMode ] 
) 
=> t

Description

Opens a string for reading, then parses and executes expressions stored in the string, just as load does in loading a file.

loadstring is different from evalstring in two ways: (1) it uses lineread mode, and (2) it always returns t if it evaluates successfully.

Arguments

t_string

Input string to be evaluated.

s_langMode

File to be loaded. Uses the file name extension to determine the language mode to use.

The valid values are:

  • 'ils, which indicates that the file contains SKILL++ code.
  • 'il, which indicates that the file contains SKILL code.

Value Returned

t

When t_string has been successfully read in and evaluated.

Signals an error if t_string is not a string, or contains ill-formed SKILL expressions.

Examples

loadstring "1+2"                      
=> t
loadstring "procedure( f(y) x=x+y )"
=> t
loadstring "x=10\n f 20\n f 30"
=> t
x
=> 60

Related Topics

evalstring

instring

load

gets


Return to top
 ⠀
X