Hello, Francisco!

Wednesday, March 18, 2009, 2:50:21 AM, you wrote:

> Is a loop the only way to initialize all the values in an array other than
> Values: array[1..2] of integer = (0,0);

> In the program I am working on, Values will be an array of 128 integers and 
> I would like to initialize them to 0.

> Right now I just using:
> for InitialLoop := 1 to 128 do
>         Values[InitialLoop] :=0;

As far as I know, global variables are initialised with zeros when an
application starts. But to ensure your array is filled with zeros you can use
FillChar:

FillChar(Values,SizeOf(Values),0)

--
Best regards,
Fantomas

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to