Flow > Conditions


Conditionals

If

if boolean

Checks whether the condition is true or false. If the condition is true, the blocks wrapped inside will execute.

if([BOOLEAN]) {
  [ACTIONS]
}

Otherwise

otherwise

Use directly below an "If" block. If the condition in the preceding "If" block is false, the blocks wrapped inside the "Otherwise" block will execute.

else {
  [ACTIONS]
}

Otherwise If

otherwise if boolean

Use directly below an "If" block. If the condition in the preceding "If" block is false, and the condition of this wrapper is true, the blocks wrapped inside the "Otherwise If" block will execute. Equivalent to doing the following:

equivalent-to-otherwise-if-block

else if([BOOLEAN]) {
  [ACTIONS]
}

Booleans

Booleans (denoted by a hexagon shape) are conditions that resolve to true or false.

And

boolean and boolean

Returns true if both of the provided conditions are true. If the first condition is false, the second condition will not be evaluated.

[BOOLEAN] && [BOOLEAN]

Or

boolean or boolean

Returns true if at least one of the provided conditions is true. If the first condition is true, the second condition will not be evaluated.

[BOOLEAN] || [BOOLEAN]

Not

not boolean

Returns true if the condition resolves to false. Testing if not [CONDITION] is equivalent to if [CONDITION] = false.

![BOOLEAN]

True / False

true false

Literal values of true and false.

true
false

Equality

Equals

object = object

Returns true if both values are equal.

[VALUE] == [VALUE]

Not Equal

object not = object

Returns true if the values are not equal.

[VALUE] != [VALUE]

Comparators

Returns true if...

Operator Description
number < number First number is smaller than second number.
number <= number First number is smaller than or equal to than second number.
number > number First number is larger than second number.
number >= number First number is larger than or equal to second number.
[NUMBER] < [NUMBER]
[NUMBER] <= [NUMBER]
[NUMBER] > [NUMBER]
[NUMBER] >= [NUMBER]

Conversion

Boolean Conversion

object as boolean

Converts the given value (typically text) into a Boolean. May throw a compile-time or runtime error if conversion is not possible.

asBoolean([VALUE])

Stop

Stop

stop

Skips the rest of the code in this event for the current step/frame.

return;