Table of Contents
Operators are used to perform operations on variables and values.
In Overbasic there are various types of operators: Assignment, Arithmetic, Boolean Logic and Comparison.
Assignment Operator #
The “=” (equal) operator is used to assign a value or the result of an expression to a variable:
Dim a As Numeric = 10
a = 5 * 4
Dim b As Boolean = False
b = (a > 10)
Arithmetic Operators #
+ | Addition: 7 + 3 = 10 |
– | Subtraction: 7 – 3 = 4 |
* | Moltiplication: 7 * 3 = 21 |
/ | Division: 8 / 4 = 2 |
\ | Divides two numbers and returns only the remainder: 7 \ 3 = 1 |
^ | Raises a number to the power of another number: 2 ^ 3 = 8 |
Comparison Operators #
Comparison operators compare two operands. They return TRUE if the condition is met, otherwise FALSE.
= | Equal to: A = B | True if A is equal to B |
> | Greater than: A > B | True if A is greater than B |
>= | Greater than or equal to: A >= B | True if A is greater than or equal to B |
< | Less than: A < B | True if A is less than A |
<= | Less than or equal to: A <= B | True if A is less than or equal to B |
<> | Not equal to: A <> B | True if A is not equal to B |
Boolean Logic Operators #
AND | A and B | TRUE if A and B are TRUE, otherwise FALSE |
OR | A or B | TRUE if A or B is TRUE, otherwise FALSE |
NOT | not A | TRUE if A is FALSE, FALSE if A is TRUE |
String Operators #
& | Joins two strings together: Dim s As String = “ABC” s = s & “DEF” Result: “ABCDEF” |