Loading...
The Scripting Cheat is primarily meant for all programmers that are familiar with the Widget Designer scripting language. Click here to download the sheet as a pdf file.
Local variablesUsing the "var" keyword variables can be defined that only exist within the scope (e.g. script or block) where they were defined. The variable's type is automatically determined by evaluating the assigned default value. |
var y = 23 |
LiteralsAnything that declares a literal expression (i.e. is not a number, command, function, variable…) must be enclosed in double quotation marks. |
var myNumber = 1.23 |
ParametersCommand parameters must be enclosed in round brackets. Advantage: parameters can be nested, i.e. a parameter can contain a function that has its own set of parameters. |
WDLabelText(1, |
Object NotationCommands that apply to a widget can also be called using "object notation", i.e. by specifying the object and method. Not just widgets, but practically all items have methods or properties (depending on their type) that can be accessed using the object notation. |
label1.Text="abCDEfgh" DebugMessage(x, x.Length) |
ExpressionsMathematical expressions (formerly requiring the "Math" keyword) are now accessible as global functions. |
|
ConditionsConditions can be combined (using "and"/"or"), nested and are not "space sensitive" anymore. |
|
If ElseAll code blocks are now enclosed in curly brackets. These can be at the end of a line or the beginning of the next one. "If" can now be followed by any number of "ElseIf" statements and one "Else". |
|
Select is now SwitchThe former "Select" command was renamed to "Switch". |
|
For LoopsLoops implemented with "For" now define the loop-variable and can optionally contain a "Step" parameter. |
|
ForEach LoopsThis command loops through a list. Define a loop variable and specify the list to loop through. In each iteration "item" will hold a member from the list "list". |
var list = [1,7.2,true, "PandorasBox"] ForEach item in list { Result: 1 7.2 true PandorasBox |