Hi everyone. Quick beginner question. If you have a dynamic array declared as a global named X, and you pass it by reference to a function, is it legal in Pascal to resize array X from inside the function?
if you mean something like thisCode: Pascal [Select][+][-]procedure Setit(var X:Array of Byte);begin SetLength(X,100);end;
if you mean something like thisCode: Pascal [Select][+][-]procedure Setit(var X:Array of Byte);begin SetLength(X,100);end; ? No, it does not compile in 3.0.4 nor 3.2.0 states it's a type mismatch. vary interesting ...
Cause that's an open array and not a dynamic array. They are two different things.
Quote from: PascalDragon on January 14, 2022, 09:14:42 pmCause that's an open array and not a dynamic array. They are two different things.But they look identical