
GeoBASIC Reference Manual
2.GeoBasic Constructs
TPS1100-Version 1.30
2-17
2.3 DATA
DECLARATIONS
2.3.1
Declaration of Constants
Syntax:
ConstantDeclaration ::= "
CONST
" Name [ "
AS
" DataType ]
"
=
" Expression
The expression is evaluated at compile time and must therefore contain constants
only. All GeoB
ASIC
operators may be used, including comparisons and logical
operators, but no functions. The name of the constant can subsequently be used
wherever a constant of this type is allowed. It is known only inside the unit in
which it was declared.
The optional type specification is used to specify an explicit type, e.g. for values of
one of the specialities of
Double
.
In the definitions in the remainder of this document, wherever "Constant" is used
in a term, either alone or with a qualifier, such as
IntegerConstant
etc.,
either an explicitly written constant as defined in Sections 2.1.6 on
Numbers, 2.1.7 on Strings, 2.1.8 on Logical Values, or the name of a declared
constant is required.
Examples:
♦
In GeoB
ASIC
the constant
Pi
is predefined. The definition corresponds to the
following constant declaration in the main program.
CONST Pi = 3.1415926
Note
It is recommended always to specify the type of the constant, even if it
is not required by the compiler.
CONST Pi AS Double = 3.1415926 'declare Pi as Double
' explicitely
♦
Also string constants can be declared. They may even extend over several lines
of code.
CONST sProgramTitle = "ATHLETICS DISTANCE MEASURENENT"
Содержание 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 ...