Quick start manual

Procedures and functions
6-21
You can omit parentheses when passing all and only the default parameters to a
routine. For example, given the procedure
procedure DoSomething(X: Real = 1.0; I: Integer = 0; S: string = '');
the following calls are equivalent.
DoSomething();
DoSomething;
Open array constructors
Open array constructors allow you to construct arrays directly within function and
procedure calls. They can be passed only as open array parameters or variant open
array parameters.
An open array constructor, like a set constructor, is a sequence of expressions
separated by commas and enclosed in brackets.
For example, given the declarations
var I, J: Integer;
procedure Add(A: array of Integer);
you could call the Add procedure with the statement
Add([5, 7, I, I + J]);
This is equivalent to
var Temp: array[0..3] of Integer;
ƒ
Temp[0] := 5;
Temp[1] := 7;
Temp[2] := I;
Temp[3] := I + J;
Add(Temp);
Open array constructors can be passed only as value or const parameters. The
expressions in a constructor must be assignment-compatible with the base type of the
array parameter. In the case of a variant open array parameter, the expressions can be
of different types.