User Tools

Site Tools


scriptoptions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

scriptoptions [2015/01/21 15:52]
skylarmt created
scriptoptions [2019/04/16 02:40]
Line 1: Line 1:
-====== 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:​ 
-<​code>​ 
-include otherfile.syjs 
-</​code>​ 
- 
-===== 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. 
-<WRAP center round tip 60%> 
-The SyMAT version code can be found in the Manual on the Welcome page, in parenthesis after the version name. 
-</​WRAP>​ 
- 
-<​code>​ 
-needs 13 
-needs 13-14 
-</​code>​ 
- 
-The first example will run on version code 13 or above, the second will not run on any version after 14. 
- 
-===== Example ===== 
- 
-script.syjs:​ 
-<​code>​ 
-//needs 13-15 
-//include otherscript.syjs 
-print("​Hello versions 13-15!"​);​ 
-print(other());​ 
-</​code>​ 
- 
-otherscript.syjs:​ 
-<​code>​ 
-function other() { 
-  return "​Function from other file"; 
-} 
-</​code>​ 
  
scriptoptions.txt ยท Last modified: 2019/04/16 02:40 (external edit)