
GeoBASIC Reference Manual
2.GeoBasic Constructs
TPS1100-Version 1.30
2-37
FunctionCall
::= FunctionName ActualParameterList
ActualParameterList ::=
"
(
" [ Expression { "
,
" Expression } ] "
)
"
A subroutine call is a statement by itself and can be written wherever statements
are allowed, while a function call is (part of) an expression and can be written
wherever expressions are allowed. Standard functions are called like user-defined
functions.
When a subroutine or function call is encountered, control passes to the called
routine. The parameters of the routine are replaced by the expressions in one of
two ways, depending on the specification of the parameter.
If the parameter was specified as
byVal
, the expression is evaluated and the
resulting value is passed to the routine as the initial value of the corresponding
parameter. If the parameter was
not
specified as
byVal
, the expression
must
be a
variable of the type specified in the parameter list (possibly an element of a
composite variable), and it is passed "by reference", i.e. for this call it takes the
place of the parameter in the routine. Any assignment to the parameter becomes an
assignment to the actual variable.
Note once again, that variables, including local ones, are not initialised by the
compiler. The value of a variable that has not been explicitly assigned a value is
undefined.
Note
Generic string parameters which are passed by reference are not
checked for overwriting length limits. Hence overwriting of subsequent
data may happen if the programmer does not care of this limits. E.g. if
the program assigns a string which is longer than the data area where the
reference is pointing to.
Passing an actual parameter to a typed string parameter (e.g. String30)
by reference is limited so far as the actual string parameter has to be of
larger or equal length than the formal string parameter. This avoids
overwriting of subsequent data.
2.7.2.1 Standard Function Calls
A standard function is called like any user-defined function, as part of an
expression, returning a value whose type depends on the function and sometimes
on the parameters. Unlike user-defined functions, some standard functions are
"overloaded", i.e. they can take parameters of different types, or a varying number
Содержание 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 ...