[fpc-pascal] Pass open array to static array?

Sven Barth pascaldragon at googlemail.com
Fri Apr 3 10:43:14 CEST 2020


Ryan Joseph via fpc-pascal <fpc-pascal at lists.freepascal.org> schrieb am
Fr., 3. Apr. 2020, 04:13:

>
>
> > On Mar 16, 2020, at 5:40 AM, Sven Barth <pascaldragon at googlemail.com>
> wrote:
> >
> > The message of the compiler is a bit misleading. It's a *dynamic* array
> that is created there, not an *open* array. Open arrays only exist when
> being passed directly to a parameter.
>
> I forgot to ask. Are open arrays constants, or are they essentially
> dynamic arrays also?
>

They are neither. They are simply a pointer to the first element and a
hidden size argument. For the pointer it is not important where it comes
from: a single element, a dynamic array, a static array.

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20200403/77c086bb/attachment.html>


More information about the fpc-pascal mailing list