
GeoBASIC Reference Manual
2.GeoBasic Constructs
TPS1100-Version 1.30
2-33
♦
We present the previous example of the
WHILE
loop now as a
FOR
loop. They
performs exactly the same calculation, for all values of
iLastIndex
.
dSum = 0
FOR iIndex = 1 to iLastIndex
dSum = dSum + NumberArray(iIndex)
NEXT iIndex
Note on the loop EXIT-Statement
All three loops — the
WHILE
loop, the
UNTIL
loop, and the
FOR
loop
— may contain one or more loop-exit-statements. If one of these is
executed, the loop terminates immediately and the statement following
it is executed. An
EXIT
-statement always exits only the innermost loop
containing it.
2.7 ROUTINES
2.7.1 Routine
Declaration
Routines come in two flavours: subroutines and functions. Functions return a value
and normally cause no change to the variables of their environment, while
subroutines often change their environment. Because they are quite similar, they
are described together.
Syntax:
RoutineDeclaration
::= ( SubroutineDeclaration |
FunctionDeclaration )
SubroutineDeclaration ::= [ "
GLOBAL
" ] "
SUB
"
SubroutineName [ ParameterList ]
Body
"
END
" [ SubroutineName ]
FunctionDeclaration ::=
"
FUNCTION
" FunctionName
ParameterList
"
AS
" DataTypeName
Body
"
END
" [ FunctionName ]
ParameterList ::=
"
(
" [ ParameterSpecification { "
,
"
ParameterSpecification } ] "
)
"
Содержание 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 ...