[fpc-pascal] Dynamic Arrays in Procedures

Sven Barth pascaldragon at googlemail.com
Mon Oct 5 08:00:40 CEST 2020


James Richters via fpc-pascal <fpc-pascal at lists.freepascal.org> schrieb am
So., 4. Okt. 2020, 23:44:

> So it does...
>
> I should have tested my own example.   I found my problem, I declared it
> as Var and it would only work with variables due to that
>

That's just a normal open array parameter and worked this way for a long
time already.

What's new in 3.2.0 is that you can use dynamic array parameters together
with array constructors as well.

Important: if you have "array of xxx" directly inside a parameter clause
that ja *always* an open array. For a dynamic array you need to explicitly
declare an array type or use an inline specialization of TArray<>.

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20201005/d618e932/attachment.htm>


More information about the fpc-pascal mailing list