Re: [fpc-pascal] More fun with dynamic arrays

2011-11-17 Thread Jürgen Hestermann
andrew.benn...@ns.sympatico.ca schrieb: Procedure Init(Out X : DataA ; Const N : Longint) ; 1) I substitute "Var" for "Out". This leads to the warning that X is not initialized. Which is correct. If you define a parameter to be for "out"put only the compiler does exactly this. 2) I sub

[fpc-pascal] More fun with dynamic arrays

2011-11-17 Thread andrew.bennett
This program: Program TestMem ; Const ASize = 1000 ; Type DataA = Array Of Longint ; Var A : DataA ; Procedure Init(Out X : DataA ; Const N : Longint) ; Begin Writeln(Length(X)) ; { Writes: 0 } End ; Begin SetLength(A, ASize) ; Writeln(Length(A)) ; { Writes: 1000 as expected } Init(A, ASiz