Code: Select all
character.q
Debug SizeOf(character); displays 2
character2.q
Debug SizeOf(character2); displays 8
ascii.f
Debug SizeOf(ascii); displays 1
ascii2.f
Debug SizeOf(ascii2); displays 4

Code: Select all
character.q
Debug SizeOf(character); displays 2
character2.q
Debug SizeOf(character2); displays 8
ascii.f
Debug SizeOf(ascii); displays 1
ascii2.f
Debug SizeOf(ascii2); displays 4
So, yes, it es normal.Syntax
Size = SizeOf(Type)
Description
SizeOf can be used to find the size of any complex Structure, built-in type (word, float, etc.), Interface or even ReferenceLink "variables" "variables" (Structures with same name as variable take precedence). This can be useful in many areas such as calculating memory requirements for operations, using API commands, etc.

Code: Select all
;PB is very flexible.
#Vector4=4711
Define Vector4
Dim Vector4(42)
;NewList Vector4()
;NewMap Vector4()
;Procedure Vector4(): EndProcedure
DeclareModule Vector4 : EndDeclareModule : Module Vector4 : EndModule
Vector4:
Enumeration Vector4 : #One : #Two : #Three : EndEnumeration
;Prototype Vector4()
;Interface Vector4 : EndInterface
CompilerIf Defined(Vector4,#PB_Constant)
Debug "Vector4 is a Constant."
CompilerEndIf
CompilerIf Defined(Vector4,#PB_Variable)
Debug "Vector4 is a Variable."
CompilerEndIf
CompilerIf Defined(Vector4,#PB_Array)
Debug "Vector4 is a Array."
CompilerEndIf
CompilerIf Defined(Vector4,#PB_List)
Debug "Vector4 is a List."
CompilerEndIf
CompilerIf Defined(Vector4,#PB_Map)
Debug "Vector4 is a Map."
CompilerEndIf
CompilerIf Defined(Vector4,#PB_Structure)
Debug "Vector4 is a Structure."
CompilerEndIf
CompilerIf Defined(Vector4,#PB_Procedure)
Debug "Vector4 is a Procedure."
CompilerEndIf
CompilerIf Defined(Vector4,#PB_Module)
Debug "Vector4 is a Module."
CompilerEndIf
CompilerIf Defined(Vector4,#PB_Label)
Debug "Vector4 is a Label."
CompilerEndIf
CompilerIf Defined(Vector4,#PB_Enumeration)
Debug "Vector4 is a Enumeration."
CompilerEndIf
CompilerIf Defined(Vector4,#PB_Prototype)
Debug "Vector4 is a Prototype."
CompilerEndIf
CompilerIf Defined(Vector4,#PB_Interface)
Debug "Vector4 is a Interface."
CompilerEndIf
Debug "SizeOf(Vector4):"+Str(SizeOf(Vector4))
Debug "TypeOf(Vector4):"+Str(TypeOf(Vector4)) +" "+Str(#PB_Structure)
; Structure Vector4
; x.f
; y.f
; z.f
; w.f
; EndStructure
; Vector4 is a Constant.
; Vector4 is a Variable.
; Vector4 is a Array.
; Vector4 is a Structure.
; Vector4 is a Module.
; Vector4 is a Label.
; Vector4 is a Enumeration.
; SizeOf(Vector4):16
; TypeOf(Vector4):7 7
Code: Select all
Define character.Q ; here, an error should occur.
Debug SizeOf(CHARACTER); displays 2
Define character2.q
Debug SizeOf(character2); displays 8
Code: Select all
Structure Character
c.c
EndStructure
