At best, one could say that the demonstrated code "a: 1 as boolean" (sort of an implicit bitfied) results in unpredictable behaviour. It shouldn't be allowed in my opinion. When inserting integers in-between, the results are "correct": type UDT a: 1 as boolean aa as integer b: 1 as boolean bb as integer c: 1 as boolean cc as integer end type dim x as UDT dim value as uinteger = 1 x.a = value print x.a x.b = value print x.b x.c = value print x.c Remark: tested with FBC 1.06
At best, one could say that the demonstrated code "a: 1 as boolean" (implicit bitfied) results in unpredictable behaviour. It shouldn't be allowed in my opinion. When inserting integers in-between, the results are "correct": type UDT a: 1 as boolean aa as integer b: 1 as boolean bb as integer c: 1 as boolean cc as integer end type dim x as UDT dim value as uinteger = 1 x.a = value print x.a x.b = value print x.b x.c = value print x.c
At best, one could say that the demonstrated code "a: 1 as boolean" (implicit bitfied) results in unpredictable behaviour. It shouldn't be allowed in my opinion. When inserting integers in-between, the results are "correct": type UDT a: 1 as boolean d as integer b: 1 as boolean e as integer c: 1 as boolean f as integer end type dim x as UDT dim value as uinteger = 1 x.a = value print x.a x.b = value print x.b x.c = value print x.c
At best, one could say that the demonstrated code "a: 1 as boolean" results in unpredictable behaviour. It shouldn't be allowed in my opinion. When inserting integers in-between, the results are different: type UDT a: 1 as boolean d as integer b: 1 as boolean e as integer c: 1 as boolean f as integer end type dim x as UDT dim value as uinteger = 1 x.a = value print x.a x.b = value print x.b x.c = value print x.c
In your example, a, b and c are not booleans. They are integers. The following code works as expected: type UDT a as boolean = 1u b as boolean = 1 c as boolean = -1 end type dim x as UDT dim as uinteger value = 1 print x.a, x.b, x.c x.a = value print x.a
In your example, a, b and c are not booleans. The following code works as expected: type UDT a as boolean = 1u b as boolean = 1 c as boolean = -1 end type dim x as UDT dim as uinteger value = 1 print x.a, x.b, x.c x.a = value print x.a
In your example, a, b and c are not booleans. The following code works as expected: type UDT a as boolean = 1u b as boolean = 1 c as boolean = -1 end type dim x as UDT dim as uinteger value = 1 print x.a, x.b, x.c x.a = value print x.a
That would probably be more a task for an IDE or RAD environment.