Comparison
(→Example) |
|||
(10 intermediate revisions by one user not shown) | |||
Line 5: | Line 5: | ||
The first value is compared to the second value to determine if the statement is true. Either value can be in the form of a table cell, list item, or a variable. | The first value is compared to the second value to determine if the statement is true. Either value can be in the form of a table cell, list item, or a variable. | ||
+ | |||
'''First Value:''' The first value being compared. Variables and functions such as [[$next list item]], [[$list item]], [[$random list item]], [[$previous list item]], and [[$table cell]] can represent a value. | '''First Value:''' The first value being compared. Variables and functions such as [[$next list item]], [[$list item]], [[$random list item]], [[$previous list item]], and [[$table cell]] can represent a value. | ||
+ | |||
'''Condition:''' Includes the following conditions: | '''Condition:''' Includes the following conditions: | ||
− | '=' | + | '''=''' :checks for equality between two values. |
− | '!=' checks for inequality between two values. | + | '''!=''' :checks for inequality between two values. |
− | < checks if the first value is less than the second value. | + | '''<''' :checks if the first value is less than the second value. |
− | <= checks if the first value is less than or equal to the second value. | + | '''<=''' :checks if the first value is less than or equal to the second value. |
− | > checks if the first value is greater than the second value. | + | '''>''' :checks if the first value is greater than the second value. |
− | >= checks if the first value is greater than or equal to the second value. | + | '''>=''' :checks if the first value is greater than or equal to the second value. |
Line 41: | Line 43: | ||
</pre> | </pre> | ||
− | |||
+ | Since 1 is not equal to 0, the [[Else]] command runs. | ||
− | [[File: | + | |
+ | [[File:comp.jpg]] | ||
Line 60: | Line 63: | ||
</pre> | </pre> | ||
− | Since 1 is greater than 0, the | + | |
+ | Since 1 is greater than 0, the [[Then]] command runs. | ||
− | [[File: | + | [[File:comp0.jpg]] |
Latest revision as of 18:52, 29 September 2013
This function is a Qualifier Function. This function compares two values and returns the results as either being true or false.
This function is also commonly used in a conditional statement to help determine which commands will run if the conditional is met.
The first value is compared to the second value to determine if the statement is true. Either value can be in the form of a table cell, list item, or a variable.
First Value: The first value being compared. Variables and functions such as $next list item, $list item, $random list item, $previous list item, and $table cell can represent a value.
Condition: Includes the following conditions:
= :checks for equality between two values.
!= :checks for inequality between two values.
< :checks if the first value is less than the second value.
<= :checks if the first value is less than or equal to the second value.
> :checks if the first value is greater than the second value.
>= :checks if the first value is greater than or equal to the second value.
Second Value: The second value being compared. Variables and functions such as $next list item, $list item, $random list item, $previous list item, and $table cell can represent a value.
[edit] Example
if($comparison(1, "=", 0)) { then { navigate("http://www.ubotstudio.com/resources", "Wait") } else { navigate("google.com", "Wait") } }
Since 1 is not equal to 0, the Else command runs.
if($comparison(1, ">", 0)) { then { navigate("http://www.ubotstudio.com/resources", "Wait") } else { navigate("google.com", "Wait") } }
Since 1 is greater than 0, the Then command runs.