[fpc-pascal]How to know the size of a untype var parameter

Florian Klaempfl Florian.Klaempfl at gmx.de
Wed Dec 4 17:30:08 CET 2002


Judison wrote:
> Hi all,
> 
> There is a way to know the size of a untype var param?
> 
> Something like this:
> 
> procedure MyProc(var A);
> begin
>   WriteLn('SizeOf(A) = ', SizeOf(A));
> end;
> 
> but it always returns 4, as Data is a actually a pointer, SizeOf(A^) does not compile, SizeOf(Pointer(A)^), Pointer(A) is typecasting the data pointed by A... 
> 

You've to pass the size in an extra parameter.






More information about the fpc-pascal mailing list