Revision history for KeyPgSizeof


Revision [21711]

Last edited on 2016-11-24 14:20:13 by fxm [Reworded note about arrays]
Additions:
For clarity, it is recommended that you avoid this potential confusion, and use ##**Sizeof**## directly on an array element or the array datatype doing ##**Sizeof**(//array//(//i//))## or ##**Sizeof**(//Typeof//(//array//))##, rather than the whole array doing ##**Sizeof**(//array//)##.
Deletions:
For clarity, it is recommended that you avoid this potential confusion, and use ##**Sizeof**## directly on an array element, rather than the whole array.


Revision [21139]

Edited on 2016-03-13 10:55:57 by fxm [Formatting]
Additions:





Revision [20527]

Edited on 2016-02-10 16:08:50 by DkLwikki [Update link format]
Additions:
**Sizeof** ( //variable// | [[DataType|DataType]] )
The ##**Sizeof**## operator returns the number of bytes taken up by a ##//variable//## or ##[[DataType|DataType]]##.
Different from ##[[KeyPgLen|Len]]##, when used with fixed-length strings (including fixed-length ##[[KeyPgZstring|Zstring]]##s and ##[[KeyPgWstring|Wstring]]##s) it will return the number of bytes they use, and when used with variable-length strings, it will return the size of the string descriptor.
- Not available in the //[[CompilerOptlang|-lang qb]]// dialect unless referenced with the alias ##**""__Sizeof""**##.
- ##[[KeyPgLen|Len]]##
Deletions:
**Sizeof** ( //variable// | [[DataType DataType]] )
The ##**Sizeof**## operator returns the number of bytes taken up by a ##//variable//## or ##[[DataType DataType]]##.
Different from ##[[KeyPgLen Len]]##, when used with fixed-length strings (including fixed-length ##[[KeyPgZstring Zstring]]##s and ##[[KeyPgWstring Wstring]]##s) it will return the number of bytes they use, and when used with variable-length strings, it will return the size of the string descriptor.
- Not available in the //[[CompilerOptlang -lang qb]]// dialect unless referenced with the alias ##**""__Sizeof""**##.
- ##[[KeyPgLen Len]]##


Revision [17659]

Edited on 2015-05-29 15:27:52 by FxMwikki [Improved wording]
Additions:
If there is both a user defined type and a variable visible with the same name in the current scope, the user defined type takes precedence over the variable. To ensure that the ##**Sizeof**## takes the variable instead of the user defined type, wrap the argument to ##**Sizeof**## with parentheses to force it to be seen as an expression. For example ##Sizeof((variable))##.
Deletions:
If there is both a user defined type and a variable both having the same name in the same scope, the user defined type takes precedence over the variable. To ensure that the ##**Sizeof**## takes the variable instead of the user defined type, wrap the argument to ##**Sizeof**## with parentheses to force it to be seen as an expression. For example ##Sizeof((variable))##.


Revision [17093]

Edited on 2014-06-14 00:44:35 by FxMwikki [As already done for LEN, added similar explanation on usage of SIZEOF((variable))]
Additions:
If there is both a user defined type and a variable both having the same name in the same scope, the user defined type takes precedence over the variable. To ensure that the ##**Sizeof**## takes the variable instead of the user defined type, wrap the argument to ##**Sizeof**## with parentheses to force it to be seen as an expression. For example ##Sizeof((variable))##.


Revision [16923]

Edited on 2013-08-29 16:37:55 by FxMwikki [sizeof( *z/wstringptr ) returns now sizeof( z/wstring ) instead of 0]
Additions:
Remark: When used with a dereferenced z/wstring pointer, ##**Sizeof**## always returns the number of bytes taken up by one z/wstring character (instead of 0 before fbc version 0.90).
Deletions:
Remark: When used with a dereferenced z/wstring pointer, ##**Sizeof**## returns the number of bytes taken up by one z/wstring character (instead of 0 before fbc version 0.90).


Revision [16922]

Edited on 2013-08-29 16:34:39 by FxMwikki [sizeof( *z/wstringptr ) returns now sizeof( z/wstring ) instead of 0]
Additions:
Remark: When used with a dereferenced z/wstring pointer, ##**Sizeof**## returns the number of bytes taken up by one z/wstring character (instead of 0 before fbc version 0.90).


Revision [13817]

Edited on 2008-10-29 07:55:18 by CountingPine [More on the Array issue]
Additions:
For clarity, it is recommended that you avoid this potential confusion, and use ##**Sizeof**## directly on an array element, rather than the whole array.
Deletions:
For clarity, it is recommended that you avoid this potential confusion, and use ##**SizeOf**## on an array element, rather than the whole array.


Revision [13816]

Edited on 2008-10-29 07:53:16 by CountingPine [More on the Array issue]
Additions:
For clarity, it is recommended that you avoid this potential confusion, and use ##**SizeOf**## on an array element, rather than the whole array.


Revision [13815]

Edited on 2008-10-29 07:48:49 by CountingPine [Sizeof with arrays]
Additions:
The ##**Sizeof**## operator returns the number of bytes taken up by a ##//variable//## or ##[[DataType DataType]]##.
Different from ##[[KeyPgLen Len]]##, when used with fixed-length strings (including fixed-length ##[[KeyPgZstring Zstring]]##s and ##[[KeyPgWstring Wstring]]##s) it will return the number of bytes they use, and when used with variable-length strings, it will return the size of the string descriptor.
Note: When used with arrays, ##**Sizeof**## returns the size of a single element of the array. This differs from its behavior in C, where arrays could only be a fixed size, and ##sizeof()## would return the number of it used.
- New to ""FreeBASIC""
Deletions:
The ##Sizeof## operator returns the length of a //variable// or [[DataType DataType]].
Different from ##[[KeyPgLen Len]]##, when used with fixed-length strings (including ##[[KeyPgZstring Zstring]]##s and ##[[KeyPgWstring Wstring]]##s) it will return the number of bytes allocated, and when used with variable-length strings, it will return the size of the string descriptor.
- New to FreeBASIC


Revision [13180]

The oldest known version of this page was created on 2008-04-24 15:44:30 by JeffMarshall [Sizeof with arrays]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode