Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
function SizeOf(X) : integer
Returns the number of bytes occupied by a variable or type
When you pass a variable reference to SizeOf it returns the number the varable occupies. Pass a type identifier to SizeOf to determine the number of bytes used to represent instances of that type.
var S: array[0..79] of char;
// Set to all zeros
FillChar(S, SizeOf(S), Ord('0'));
(* second example *)
type TOnlineAddress = record
email: string[30];
url: string[100];
end;
var AOnlineAddress : TOnlineAddress;
//one AOnlineAddress variable holds SizeOf(AOnlineAddress) bytes.
|
StringOfChar, FillChar,
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|