This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.
This version is copyright and may only be used for local testing purposes. It may not be distributed.
Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.
Description
Used to compare expressions.
Syntax
result = expression1 comparisonoperator expression2
Comparison operators have these parts:
| Part | Description |
| result | Any numeric variable. |
| expression1 | Any expression. |
| comparisonoperator | Any comparison operator. |
| expression2 | Any expression. |
Returns
Number
Remarks
The following table contains a list of the comparison operators and the conditions that determine whether result is True, False.
Operator |
Description |
True if |
False If |
< |
Less than |
expression1 < expression2 |
expression1 >= expression2 |
<= or =< |
Less than or equal to |
expression1 <= expression2 |
expression1 > expression2 |
> |
Greater than |
expression1 > expression2 |
expression1 <= expression2 |
>= or => |
Greater than or equal to |
expression1 >= expression2 |
expression1 < expression2 |
= |
Equal to |
expression1 = expression2 |
expression1 <> expression2 |
<> |
Not equal to |
expression1 <> expression2 |
expression1 = expression2 |
When comparing two expressions, you may not be able to easily determine whether the expressions are being compared as numbers or as strings. thinBasic performs internal conversions in order to determine correct values. In general it will mostly depend from what is expected.
For example:
•if a string expression is expected, comparison will take place comparing strings. All numbers or number returned by functions calling will be converted to strings;
•if a numeric expression is expected, comparison will take place comparing numbers. All strings or strings returned by functions calling will be converted to numbers;
Restrictions
See also
Examples