next up previous contents index
Next: Technology File Up: Control Functions Previous: Prompt Line   Contents   Index

Scripts

(stringlist_handle) ListFunctions()
This function will re-read all of the library files in the script search path, and return a handle to a string list of the functions available from the libraries.

(untyped) Exec(script)
This function will execute a script. The argument is a string giving the script name or path. If the script is a file, it must have a ``.scr'' extension. The ``.scr'' extension is optional in the argument. If no path is given, the script will be opened from the search path or from the internal list of scripts read from the technology file or added with the !script command. If a path is given, that file will be executed, if found. It is also possible to reference a script which appears in a submenu of the User Menu by giving a modified path of the form ``@@/libname/.../scriptname''. The libname is the name of the script menu, the ... indicates more script menus if the menu is more than one deep, and the last component is the name of the script.

The return value is the result of the expression following ``return'' if a return statement caused termination of the script being executed. If the script did not terminate with a return statement with a following expression, the integer 1 is returned by Exec. If the script indicated by the argument to Exec could not be found, integer 0 is returned. If the return statement is used, the type of the return is determined by the type of object being returned.

Example: script1.scr

(executable lines)
return 3
in main script:
Print(Exec("script1")) # prints "3"

(int) SetKey(password)
This function sets the key used by Xic to decrypt encrypted scripts. The password must be the same as that used to encrypt the scripts. This function returns 1 on success, i.e., the key has been set, or 0 on failure, which shouldn't happen as even an empty string is a valid password.


next up previous contents index
Next: Technology File Up: Control Functions Previous: Prompt Line   Contents   Index
Stephen R. Whiteley 2006-10-23