
GeoBASIC Reference Manual
2.GeoBasic Constructs
2-36 TPS1100-Version
1.30
FOR i = 1 to n
'for all elem. in the first dim.
FOR j = 1 to m 'for all elem. in the second dim.
dSum = dSum + Matrix(i, j) 'sum up the elem.
NEXT j
NEXT i
AverageAngle = dSum / (n*m) 'assign the mean as
' return value
END AverageAngle
♦
The next example shows a possible use of the
EXIT SUB
statement, and the
difference to the loop
EXIT
statement.
SUB RoutineWithExit
'description: demonstrates EXIT SUB and EXIT
DIM i
AS Integer
DIM lOk
AS Logical
DIM lCond AS Logical
...
lOk = TRUE
DO WHILE lOk
FOR i = 1 TO n
'do something
IF Error() THEN
EXIT SUB
' terminates the subroutine
END IF
IF lCond then
EXIT
' terminates the loop
END IF
NEXT i
'this will be executed after "EXIT" but
' not after "EXIT SUB"
LOOP
END RoutineWithExit
2.7.2 Routine
Calls
Syntax:
SubroutineCall
::= [ "
CALL
" ] SubroutineName
[ ActualParameterList ]
Содержание 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 ...