System.SizeOf

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function SizeOf(var X): Integer;

Properties

Type Visibility Source Unit Parent
function public System.pas System System

Description

Returns the number of bytes occupied by a variable or type.

Pass a Object Pascal variable reference to SizeOf to determine the number of bytes used to represent the variable. Pass a type identifier to SizeOf to determine the number of bytes used to represent instances of that type. SizeOf is useful for determining the amount of memory to specify for the FillChar, Move, or GetMem procedures.

SizeOf returns 0 when the argument is an untyped variable.

See Also

Code Examples