Product Documentation
Cadence SKILL Development Reference
Product Version IC23.1, June 2023

saveContext

saveContext( 
t_contextFileName 
[ g_ignore64bitSubpath ]
) 
=> t / nil

Description

Saves the current state of the SKILL language interpreter as a binary file. This function must be used in conjunction with setContext.

If the optional argument is specified the function does not add /64bit subpath to the context file path.

Saves all function and variable definitions that occur, usually due to file loading, between the calls to setContext and saveContext. Those definitions can then be loaded into a future session much faster in the form of a context using the loadContext function.

By default all functions defined in a context are read and write protected unless the writeProtect system switch was turned off (by setting (sstatus writeProtect nil)) when the function in question was defined between the calls to setContext and saveContext.

Arguments

t_contextFileName

Name of binary file to which the current state of the interpreter is written. To load or set the saved context using loadContext or setContext respectively, ensure that this name is specified.

g_ignore64bitSubpath

Specifies whether /64bit should be added to the context file path or not. If set to t, the context is saved in the current directory and /64bit is not added to the context file path.

Value Returned

t

Context was successfully saved.

nil

If the saving process failed due to one of the following conditions: failed to open/create a file, exhaustion of virtual memory, presence of bad objects (such as port, db handles, and so forth)

Examples

setContext("myContext")           
=> t
load("mySkillCode.il")           
=> t
defInitProc("myContext" 'myInit)   
=> t

Saves as “64bit/myContext.cxt” in the SKILL path

saveContext("myContext.cxt")     
=> t

Saves as “myContext.cxt” in the SKILL path

saveContext("myContext.cxt" t)     
=> t

Related Topics

Context Functions

defInitProc

loadContext

setContext


Return to top
 ⠀
X