Returns the size of a variable or type in bytes.
Syntax
Description
The
Sizeof operator returns the length of a
variable or
DataType.
Different from
Len, when used with fixed-length strings (including
ZStrings and
WStrings) it will return the number of bytes allocated, and when used with variable-length strings, it will return the size of the string descriptor.
Example
Print SizeOf(Byte) ' returns 1
Type bar
a As Integer
b As Double
End Type
Dim foo As bar
Print SizeOf(foo)
Dialect Differences
- Not available in the -lang qb dialect unless referenced with the alias __Sizeof.
Differences from QB
See also