Tinderbox 8 Icon

Basic action code syntax

Case sensitivity: Action code operators are always case-sensitive (unlike export codes).

Delimiters. Each discrete code expression (explained further below), must be terminated with a semi-colon. This acts like a full stop (or period) in normal text writing. Tinderbox, will run the first expression up to the first-semi-colon, before moving on the the next and so on. Queries, as used by agents, do use action code operators but use slightly different syntax and never use a delimiter.

In action code, the delimiter can be omitted in two cases.

Firstly, the action only contains one expression. Both these are valid code for the same action:

$Color="red" 

$Color="red"; 

Secondly, it is the last expression in a multi-expression action.Both these are valid code for the same action:

$Color="red";$AccentColor="blue";$StartDate=date("now") 

$Color="red";$AccentColor="blue";$StartDate=date("now"); 

Note, in this second context, how all expression except the last one must have a semi-colon delimiter.

Where a multi-expression code includes if() conditional sections, a delimiter must be placed after the closing '}' if another expression follows after. For instance:

if($Prototype=="Event"){$StartDate=date("today")} 

But:

if($Prototype=="Event"){$StartDate=date("today")};$Color="red" 

Note that the code inside the curly brackets does not need a delimiter as there is only one action. But, a further action follows the if() test so a delimiter is needed after the '}' that closes the if() action. Where there is an else branch, e.g. if(){}else{}, the delimiter goes after the '}' at the end of the else branch. code inside the {} sections obeys the rules above and only needs delimiters between multiple actions.

However, if in doubt, use a delimiter after each action!

Expression: this is a term for action code involving some evaluation, as described further here.

Coding conventions in Tinderbox. See more.

Review old code: Longtime users of Tinderbox should revisit code to ensure all string literals are quoted as current support for non-quoted string usage is for legacy purposes and will be withdrawn; by convention paths and designators are not quoted but there is no harm if they are and quoting all strings may be an easier approach for new users to take. Likewise, new users trying old code samples should be aware that the code may use legacy syntax.



A Tinderbox Reference File : Actions & Rules : Basic action code syntax