Miscellaneous
Miscellaneous functions are described in the following table.
Syntax |
Effect |
Stops the execution of the program at the current statement and, if the debugger is enabled, enters in debug mode. |
|
Converts the arguments to strings and prints them to the current debug output. The implementation of this depends on the application in which Script is embedded. The function writeln prints a newline at the end of the output, while write does not. |
|
Loads the script file whose path is string. The path can be either absolute or relative. If this path does not designate an existing file, the file is looked up using a method which depends on the application in which Script is embedded; typically, a file with the name string is searched in a list of directories specified in the application setup. |
|
Executes string as a program, and returns the value of the last evaluated expression. The program in string can use all the features of the language, except that it cannot define functions; in other words, the function statement is not allowed in string. Examples: eval("2*3") -> 6 eval("var i=0; for (var j=0; j<100; j++) i=i+j; i")-> 4950 n=25; eval("Math.sqrt(n)")-> 5 eval("function foo(x) { return x+1 }")-> error |