====== Statements ======
TIScript supports all statements of JavaScript:
if ( ) [ else ]
while [ : ] ( )
do [ : ] while ( )
for [ : ] ( [] | [var ] ; [] ; [] )
for [ : ] ( [] | [var ] in [] )
switch() { case : [...] default: }
break [];
continue [];
return [ ] ;
;
{ ... }
var [= ] [ , ... ] ;
try catch ( ) finally
include ;
assert [ : ] ;
Pay attention that syntax of named loops is different from JavaScript:
for:rows ( var r in this )
for:cells ( var c in r )
if(c.attributes#rowspan > 1) break rows;
===== include statement =====
Include statement allows to include (load) other script files into current execution scope:
include ;
Multiple inclusions of the same file allowed but file will be loaded only once - when it seen first time.
As a consequence: circular references will not cause any harm.
===== assert statement =====
An assertion is a statement that enables you to test your assumptions in your code.
Assertion statement statrts from keyword "assert" followed by expression to test and optional additional expression
to show in stderr output:
assert [ : ] ;
If will be evaluated to ''false'' then runtime will generate an Error with the text:
Assertion failed on [text of the test expression]
or
Assertion failed on [text of the test expression]: [value of second expression]