Please enable JavaScript to view this site.

thinBasic Help Manual

Navigation: ThinBASIC Core Language

Language Operators

Scroll Prev Top Next More

* * HELP & MANUAL PREMIUM PACK 4 DEMO VERSION * *

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.

 

thinBasic has a full range of operators, including arithmetic operators, comparison operators, concatenation operators, and logical operators.

 

Operator Precedence

 

When several operations occur in an expression, each part is evaluated and resolved in a predetermined order called operator precedence. You can use parentheses to override the order of precedence and force some parts of an expression to be evaluated before others. Operations within parentheses are always performed before those outside. Within parentheses, however, standard operator precedence is maintained.

 

When expressions contain operators from more than one category, arithmetic operators are evaluated first, comparison operators are evaluated next, and logical operators are evaluated last. Comparison operators all have equal precedence; that is, they are evaluated in the left-to-right order in which they appear. Arithmetic and logical operators are evaluated in the following order of precedence.

 

Arithmetic precedence

Description

Symbol

Exponentiation

^

Unary negation

-

Left byte shift

<<

Right byte shift

>>

Multiplication

*

Division

/

Integer division

\

Addition

+

Subtraction

-

 

When multiplication and division occur together in an expression, each operation is evaluated as it occurs from left to right. Likewise, when addition and subtraction occur together in an expression, each operation is evaluated in order of appearance from left to right.

 

Logical

Description

Symbol

Logical negation

NOT

Logical conjunction

AND

Logical disjunction

OR

Logical exclusion

XOR

 

Comparison

Description

Symbol

Equality

=

Inequality

<>

Less than

<

Greater than

>

Less than or equal to

<=

Greater than or equal to

>=

Inside

>< MinVal, MaxVal

 

Created with Help+Manual 8 and styled with Premium Pack Version 4 © by EC Software