[fpc-pascal] Initializers on const and var

Michael Van Canneyt michael at freepascal.org
Tue Jun 3 15:41:16 CEST 2008



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.

Michael.



More information about the fpc-pascal mailing list