Node:SizeOf, Next:SizeType, Previous:Single, Up:Reference
function SizeOf (var x): SizeType;
Returns the size of a type or variable in bytes.
SizeOf can be applied to expressions and type names. If the
argument is a polymorphic object, the size of its actual type is
returned.
SizeOf is a UCSD Pascal extension.
program SizeOfDemo;
var
a: Integer;
b: array [1 .. 8] of Char;
begin
WriteLn (SizeOf (a)); { Size of an `Integer'; often 4 bytes. }
WriteLn (SizeOf (Integer)); { The same. }
WriteLn (SizeOf (b)) { Size of eight `Char's; usually 8 bytes. }
end.