≤ (Less Than or Equal To)
The≤ node compares two integer inputs and outputs a boolean value indicating whether the first input is less than or equal to the second input.
Inputs
a(integer): The first integer to compare. Default value is 0.b(integer): The second integer to compare. Default value is 0.
Outputs
result(boolean): True ifais less than or equal tob, false otherwise.
Configuration
This node has no configuration options.Usage
To use the≤ node:
- Connect integer values to the
aandbinput ports. These can be hardcoded values, or outputs from other nodes. - The node will output a boolean value to the
resultport, which you can then use as input to other nodes or as a final output of your spell.
Example
Suppose you want to check if a user’s age is less than or equal to 18 in order to determine if they are a minor. You could use the≤ node like this:
- Connect the user’s age (e.g., from a form input or database) to the
aport. - Connect the integer value 18 to the
bport. - The
resultport will outputtrueif the user’s age is less than or equal to 18,falseotherwise. - Connect the
resultto a branch node to conditionally execute different parts of your spell based on whether the user is a minor.
Best Practices
- Ensure that the inputs to
≤are actually integers. Connecting other data types may lead to unexpected behavior. - Remember that
≤is inclusive of the second input value. If you want strict less than comparison, use the<node instead.
Common Issues
- Accidentally connecting the inputs in the wrong order. Remember, the node checks if
ais less than or equal tob, not the other way around. - Forgetting to handle both the
trueandfalsecases in your spell logic. Make sure you consider what should happen in each case.
