help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'System' (#rtl)

SizeOf

Return size of a variable or type.

Declaration

Source position: system.fpd line 46

function SizeOf(

  X: TAnyType

):LongInt;

Description

SizeOf returns the size, in bytes, of any variable or type-identifier.

Remark: This isn't really a RTL function. Its result is calculated at compile-time, and hard-coded in the executable.

Errors

None.

See also

Addr

  

Return address of a variable

Example

Program Example63;

{ Program to demonstrate the SizeOf function. }
Var
  I : Longint;
  S : String [10];

begin
  Writeln (SizeOf(I));  { Prints 4  }
  Writeln (SizeOf(S));  { Prints 11 }
end.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505