
GeoBASIC Reference Manual
2.GeoBasic Constructs
TPS1100-Version 1.30
2-35
Both the declaration and the code part may use the names that are known in the
environment of the routine, i.e. the globally declared objects, provided their
declaration preceded (in the source text) the current routine.
Note on the routine EXIT-Statement
The code part of a routine may contain one or more routine-exit-
statements, which are written as
EXIT SUB
or
EXIT FUNCTION
for a subroutine or a function, respectively. If one of these is executed,
execution of the routine terminates at that point and control passes back
to the point where the routine was called. If no such
EXIT
-statement is
executed, control returns to the point of call when the
END
of the
routine is encountered.
Examples:
♦
The subroutine
SquareAndCube
takes a
Double
as first argument (the
parameter variable
dX
) and returns the square and cube of this first argument in
the second (
dSquare
) and third (
dCube
) one.
SUB SquareAndCube( byVal dX
AS Double,
dSquare AS Double,
dCube
AS Double )
'description: the argument dX is squared and cubed
'
and returned in dSquare and dCube, respectively;
dSquare = dX * dX
dCube
= dX * dSquare
END SquareAndCube
♦
The function
AverageAngle
takes a
Matrix
of type
MatrixType
as
argument and returns the average of the matrix elements.
CONST n AS Integer = 5
' matrix dimension 1
CONST m AS Integer = 20 ' matrix dimension 2
TYPE DIM MatrixType (n,m) AS Double END
FUNCTION AverageAngle( Matrix AS MatrixType ) AS Angle
'description: Matrix is a n by m array of Angle
'
(for the declaration see Section 2.2.3)
'return: the average of all its elements
DIM dSum AS Angle
'sum of the angles
DIM i
AS Integer
'index in the first dimension
DIM j
AS Integer
'index in the second dimension
dSum = 0
'init the sum to 0
Содержание 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 ...