Comparison

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
Line 4: Line 4:
 
This function is also commonly used in a conditional statement to help determine which commands will run if the conditional is met.  
 
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 tot he 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.
 
== Example ==
 
== Example ==
  

Revision as of 19:51, 25 April 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.

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.


File:Comparison.png


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.


File:Comparison0.png

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox