User Tools

Site Tools


scriptoptions

This is an old revision of the document!


Special Script Options

Starting with SyMAT version 1.1, special comments can be used in scripts to perform several useful things. These special comments should be prepended with “//” or “##” (depending on language) and be at the start of a line with no whitespace before or after.

Include

The following snippet will be replaced by the contents of otherfile.syjs:

include otherfile.syjs

Version Specification

To prevent incompatibility between different SyMAT versions, scripts can now set a minimum and maximum version that they will be run on. SyMAT (1.1 and above) will refuse to run scripts if the SyMAT version code falls outside the range specified.

The SyMAT version code can be found in the Manual on the Welcome page, in parenthesis after the version name.

needs 13
needs 13-14

The first example will run on version code 13 or above, the second will not run on any version after 14.

Example

script.syjs:

//needs 13-15
//include otherscript.syjs
print("Hello versions 13-15!");
print(other());

otherscript.syjs:

function other() {
  return "Function from other file";
}
scriptoptions.1421880743.txt.gz · Last modified: 2019/04/16 02:40 (external edit)