[fpc-pascal] Initializers on const and var
Marc Santhoff
M.Santhoff at t-online.de
Sat Jan 1 01:32:12 CET 2005
Am Dienstag, den 03.06.2008, 15:41 +0200 schrieb Michael Van Canneyt:
>
> On Tue, 3 Jun 2008, Marc Santhoff wrote:
>
> > Hi,
> >
> > is it possible to have an array initialized with variables?
> >
> > I tried sth. like this (by accident, not intentionally):
> >
> > const
> > ctypes: array [0..9] of hid_t =
> > (
> > H5T_NATIVE_INT, H5T_C_S1, H5T_C_S1, H5T_C_S1, H5T_C_S1,
> > H5T_C_S1, H5T_C_S1, H5T_C_S1, H5T_NATIVE_HBOOL, H5T_NATIVE_HBOOL
> > );
> >
> > assuming the names in upper case are constants. But in fact they are
> > variables (declared "cvar; external" but I think that's not the cause of
> > the error).
>
> This is the error; The values must be known at compile time.
Okay, but that hold true for any kind of variable, not only those "cvar;
external;" ones.
Anyway, I'll see if changing the base type of the array to pointers is
possible.
Thanks,
Marc
More information about the fpc-pascal
mailing list