
GeoBASIC Reference Manual
2.GeoBasic Constructs
TPS1100-Version 1.30
2-15
•
For assignment and parameter passing, the variable may also be used as a
whole. Other operations can only be performed on the individual elements; in
particular, comparison of entire structures is not possible.
Example:
♦
We declare a type for Cartesian coordinates in the space.
TYPE CartesianPointType
iNumber AS Integer
'number of the coordinate
dNorth
AS Distance
'north coordinate
dEast
AS Distance
'east coordinate
dHeight AS Distance
'height coordinate
END CartesianPointType
♦
A variable of type
CartesianPointType
will consist of the four
components
iNumber
,
dNorth
,
dEast
, and
dHeight
.
iNumber
is an
integer for a point number, the others are floating point values (doubles) for the
coordinates in the space.
♦
We declare two variables of
CartesianPointType
and initialise the first
point’s components to the origin.
DIM Point1 AS CartesianPointType
DIM Point2 AS CartesianPointType
Point1.iNumber
= 1
Point1.dNorth
= 0.0
Point1.dEast
= 0.0
Point1.dHeight
= 0.0
♦
As with arrays, we can assign a whole structure at once. This is equivalent to
assigning each of the components.
Point2 = Point1
'equivalent to
' Point2.iNumber = Point1.iNumber
' Point2.dNorth
= Point1.dNorth
' Point2.dEast
= Point1.dEast
' Point2.dHeight = Point1.dHeight
♦
Now we set
Point2
’s values. Since it is initialised we only need to say where
it differs from
Point1
.
Point2.iNumber
= 2
Point2.dNorth
= 1.0
Point2.dEast
= 1.0
♦
And we can, for instance, compute the distance between
Point1
and
Point2
. (
Sqr
computes the square root, and
^2
squares its argument.)
Содержание 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 ...