[fpc-pascal] Arrays of objects

Joao Morais post at joaomorais.com.br
Wed Oct 31 13:06:21 CET 2007


Lourival Mendes wrote:
>    SetLength(Vetor, 2)
>    Vetor[0]:= 1
>    Vetor[1]:= 2
> 
>    As you can see you don't lose the first 2, After that you want 4
> elements on the same variable:
> 
>    SetLength(Vetor, 4)
> 
>    If you print the variable, before associate any value to it you will get:
> 
>    Vetor[0]:= 1
>    Vetor[1]:= 2
>    Vetor[2]:= 0
>    Vetor[3]:= 0

I assume the same based on the rtl internals -- except that you cannot 
assume values from a newly allocated area (except if you are dealing 
with objects)

--
Joao Morais




More information about the fpc-pascal mailing list