there's a way to initialize an UDT with a bitfield statically?
otherwise i will need to workaround using "flags" as member and joint constants
Code: Select all
Type MyType
A as ushort
B:1 as ubyte
C:1 as ubyte
end type
'this is ok... as no bitfield is set
static as MyType ThisWorks = type(0)
'this works... but generate runtime code to fill instead of const 0
dim as MyType GeneratesUnecessaryInitCode = type(0,0)
'those generate error messages...
'error 24: Invalid data types in "static as MyType ThisDoesNotWork = type(0,0)"
dim shared as MyType t = type(0,0)
static as MyType ThisDoesNotWork = type(0,0)
'this crashes (unrelated but worth o a note)
'Aborting due to runtime error 12 ("segmentation violation" signal)
static as MyType ThisCrash = type(0,type(0))