TIScript is a “typeless” language in other words each variable can contain value of any type.
Each value in the language is instance of some class, e.g. integer value is an instance of class Integer, etc.
Integer value is an instance of class Integer and holds signed number between Interger.MIN and Interger.MAX.
// integer // integer, hexadecimal notation 'f'// unicode code point of symbol 'f'
Float value is an instance of class Float and holds signed floating point number between Float.MIN and Float.MAX.
// float
String is an immutable sequence of Unicode code points, see Unicode. String value is an instance of class String.
String literals are enclosed by quotation marks (”) and can contain escape sequences \t,\a,\b,\n,\r,\v,\f,\\,\”,\',\ooo,\xhh or \uhhhh.
"Hello world!"// string constant
Symbol is a unique name internally represented by int32 value so e.g. comparison of two symbols is effective. Eeach symbol is an instance of class Symbol.
Symbol literals are nmtokens prepended by pound symbol (#).
// symbol Hello
TIScript use symbols for representing special values like undefined (#undefined), true (#true), false (#false), null (#null) etc.
Note that symbol literals
symbol-literal -> '#' [a-zA-Z_$0-9-]*support also '-' character in the name. This is made intentionally to support CSS and HTML attribute names that allow '-' inside. So following fragment:
// or, // equivalent of the above.will set 'line-height' style attribute equal to 12 pixels in the Sciter.
There is no special boolean type in the language. true/false are just special constants (symbols) true and false.
Array is a dynamic sequence of values a.k.a. vector of values. Each array is an instance of class Array. Array literals are comma separated lists of values enclosed by '[' and ']' symbols.
// array of three integers. // empty array
Object is an associative container of name/value pairs a.k.a. map. Each object is an instance of class Object or some class derived from it. Object literals are comma separated lists of name/value pairs enclosed by '{' and '}' symbols. Name (a.k.a. key) and value are separated by colon symbol (:).
// object having three fields. // exact equivalent of the above. "one""two""three"// strings used as keys.
Function is a “parametrized code block” - fragment of code with formal parameters. Functions are also objects - instances of class Function. Any variable can hold reference to a function. See also functions.
// short form of function literal:
Variable func1 here will hold reference to the (anonymous) function defined on the right.
TIScript allows to define new types of values (classes). User defined type may have specific set of methods, variables and constants. See chapter Classes for more details.
Regular expressions is a form of pattern matching that you can apply on textual content.
In Script you use forward slash (/) when you declare RegExp literals: /pattern/flags;
Example:
"Wrong e-mail address!"
[tbd]
[tbd]