Literals

Home Scripting Literals

In a MoStack script, you write a string literal with the help of quotation marks:

"A"  "a string literal"   ""

Two quotation marks immediately following each other like the last example above denote an empty string.

There is no support yet for any special characters in a string literal, like a way to include quotation marks or line breaks, but there are the following two named string constants for a line break and for a tabulator character:

Return   Tab

The second type of literals are number literals:

0  1234   -55

Although real (floating-point) numbers are supported as a control/field type, real literals are not yet possible.

There are no boolean literals per se, but you can use the following string literals to check/uncheck a boolean field or set a boolean variable to "true"/"false":

"T"  "F"

Date literals are not yet supported. If you need a certain constant date in your script, it's best to define a date field somewhere, give it the required value either by typing the value or use the default value feature, make the field invisible if you want to get it "out of the way", and then reference the value of the field in you script.

There is however, one predefined date variable that always contains the current system date as value:

the date

The same trick with a hidden field would of course work for real constants, e.g. if you need the constant Pi in one of your scripts.