GreaterThan
Integer
Greater Than (Integer)
The Greater Than (Integer) node compares two integer values and outputs a boolean indicating whether the first value is greater than the second.
Inputs
a
(integer, default: 0): The first value to compare.b
(integer, default: 0): The second value to compare.
Outputs
result
(boolean): True ifa
is greater thanb
, false otherwise.
Configuration
This node has no configuration options.
Usage
To use the Greater Than (Integer) node:
- Connect the integer values you want to compare to the
a
andb
input ports. - The
result
output port will emit a boolean value indicating whethera
is greater thanb
.
Example
Suppose you have a spell that needs to check if a user’s age is greater than 18. You can use the Greater Than (Integer) node to make this comparison.
- Connect the user’s age (an integer value) to the
a
input port. - Connect the integer value 18 to the
b
input port. - The
result
output port will emittrue
if the user’s age is greater than 18, andfalse
otherwise.
You can then use the result
value to conditionally execute different parts of your spell based on the user’s age.
Best Practices
- Ensure that the values connected to the
a
andb
inputs are of type integer. Connecting other data types may lead to unexpected behavior. - Remember that this node only checks if
a
is strictly greater thanb
. If you need to check for greater than or equal to, you should use a combination of the Greater Than and Equal nodes.
Common Issues
- If either of the input values is missing or not an integer, the node will output
false
. Make sure to properly handle missing or invalid data earlier in your spell. - Be careful not to confuse the order of the inputs. The node checks if
a
is greater thanb
, not the other way around.
By using the Greater Than (Integer) node, you can easily compare two integer values and make decisions in your spells based on the result. This simple but powerful node is a key building block for creating more complex logic and flow control in your Magick spells.