
GeoBASIC Reference Manual
2.GeoBasic Constructs
2-26 TPS1100-Version
1.30
2.6.1 Sequential
Statements
Syntax:
SequentialStatement ::= ( Assignment | SubroutineCall )
Assignment
::= Variable "
=
" Expression
2.6.1.1 The Assignment Statement
The expression is evaluated and the result is assigned to the variable. The type of
the variable and the type of the expression must be the same, unless they are of a
simple type. In this case they must either be both of a numeric type (
Integer
,
Double
, or any of the various specialities of
Double
), or both of type
Logical
. If the variable is of type
Integer
, the expression must also be of
type
Integer
. If the variable is one of the
Double
types and the expression is
Integer
, the result is converted to
Double
before being assigned.
If the variable is an array element, the subscript expression is evaluated before the
expression on the right hand side. (This will matter only if functions with side
effects are evaluated, which should be avoided.)
A structure variable can be assigned to another one, provided they are both of the
same structure type (same name). An array variable can be assigned to another one
if both are of the same type (same name) or if they have the same "shape" (the
same number of dimensions and the same number of elements in corresponding
dimensions) and if their elements are of the same type.
Examples:
♦
Compute the east coordinate of
Point1
out of the east coordinate of
Point2
.
Point1.dEast = 2.5 * Point2.dEast
♦
The following assignment with
i
and
j
in the appropriate bounds may occur in
some matrix computation.
Matrix(i, j) = ( Matrix(i+1, j)+Matrix(i-1, j) ) / 2.0
♦
Next, the matrix is assigned to itself. (Note that it is an assignment, not a
Boolean expression.)
Matrix = Matrix
♦
Often a logical variable (
lDone
) has to be set according to some condition.
x
and
y
must be comparable.
Содержание 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 ...