Re: Open array



Rob Kennedy wrote:
Fons Rave wrote:
procedure OpenArray;

procedure Xxx(Bbb : array of boolean);
begin
end;

That is a procedure that takes an open array.

type TArrayOfBoolean = array of boolean;

That is a dynamic array.

procedure Yyy(Bbb : TArrayOfBoolean);
begin
end;

That is a procedure that takes a dynamic array.

That is so confusing. I still have to think twice when I declare a routine
and a variable with this syntax. Strange they didn't distinguish between the
two.

--
Bjørge
bjorge@xxxxxxxxxxxx


.



Relevant Pages

  • Re: Open array
    ... That passes either a set of Boolean or an open array of Boolean to a procedure expecting a dynamic array. ...
    (comp.lang.pascal.delphi.misc)
  • Dynamic array initialized values
    ... Is it safe to assume the default values for newly allocated elements ... of a dynamic array are initialized to some default value? ... dynarray: array of boolean; ...
    (comp.lang.pascal.delphi.misc)
  • Re: How do I pass a string array to a component?
    ... thing as an open array type; you can only have an open array parameter ... Using it as a parameter type, it remains a dynamic array. ... pointer) to the first element in the destination for N*S ... Declare the property and its backing field as TStrings. ...
    (alt.comp.lang.borland-delphi)
  • Re: How do I pass a string array to a component?
    ... > thing as an open array type; you can only have an open array parameter ... > type that looks like an open array becomes a dynamic array instead. ... do that with a TStrings property. ...
    (alt.comp.lang.borland-delphi)