Overbasic – Operators

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 = BTrue if A is equal to B
>Greater than: A > BTrue if A is greater than B
>=Greater than or equal to: A >= BTrue if A is greater than or equal to B
<Less than: A < BTrue if A is less than A
<=Less than or equal to: A <= BTrue if A is less than or equal to B
<>Not equal to: A <> BTrue if A is not equal to B

Boolean Logic Operators #

ANDA and BTRUE if A and B are TRUE, otherwise FALSE
ORA or BTRUE if A or B is TRUE, otherwise FALSE
NOTnot ATRUE if A is FALSE, FALSE if A is TRUE