
GeoBASIC Reference Manual
2.GeoBasic Constructs
2-22 TPS1100-Version
1.30
"
(
" Expression "
)
" )
The operators have their usual meaning, as found in many programming
languages. The logical operators
OR
,
AND
, and
NOT
stand for the inclusive
logical or, the logical and, and the logical not. The relational operators
=
,
<>
,
>
,
<
,
>=
,
<=
stand for "equal to", "not equal to", "greater than", "less than", "greater
than or equal to", and "less than or equal to", respectively. The arithmetic
operators
+
,
-
,
*
,
/
,
\
,
MOD
and
^
stand for addition, subtraction, multiplication,
floating point division, integer division, remainder, and power, respectively.
Aside from its use as arithmetic addition operator, the
+
operator is also used for
string concatenation.
The syntax for the expressions reflects the precedence of the operators; thus, the
logical
OR
operator has the lowest precedence, since both
LogicalTerms
are
evaluated before the or takes place. The parameters of function calls are evaluated
before the function itself. Functions and parenthesised expressions are evaluated
before any operations involving them. All operations on the same level are
evaluated from left to right, with the exception of powers, which are evaluated
from right to left, i.e.
x^3^2
is the same as
x^(3^2)
(=
x^9
) and not
(x^3)^2
(=
x^6
) . Multiplication, division, and remainder are evaluated before addition
and subtraction. Arithmetic operations and string concatenation are performed
before comparisons, and comparisons before logical operations. In logical
operations,
NOT
is performed before
AND
, which is performed before
OR
.
Note
In case of doubt about the precedence, or to make the intention clear to
the reader, parentheses are recommended.
Examples
♦
First we declare some variables that will be used.
DIM a AS Double
DIM b AS Double
DIM c AS Double
DIM i AS Integer
DIM j AS Integer
DIM k AS Integer
DIM x AS Logical
DIM y AS Logical
DIM z AS Logical
DIM s AS String20
Содержание tps1100
Страница 1: ...GeoBASIC FOR TPS1100 User Manual Version 2 10 1997 2001 Leica Geosystems AG Heerbrugg Switzerland ...
Страница 150: ...GeoBASIC FOR TPS1100 Reference Manual Version 2 10 1997 2001 Leica Geosystems AG Heerbrugg Switzerland ...
Страница 411: ...GeoBASIC Reference Manual 6 System Functions TPS1100 Version 1 30 6 7 6 5 35 CSV_LibCallAvailable 6 213 ...
Страница 620: ...TPS1100 Version 2 10 6 1 ...
Страница 621: ......
Страница 623: ...TPS1100 Version 2 10 6 1 ...
Страница 624: ......
Страница 1053: ...TPS1100 Version 1 30 E 1 Appendix E GEOFONT ...
Страница 1154: ...GeoBASIC Reference Manual Appendix J List of Predefined Identifiers TPS1100 Version 1 30 J 9 TMC_SetOffsetDist 6 128 ...