This completes the rollout of O2's default value-setting for functions, macros and now, types.
Potentially useful for setting values in large or complex UDT variables.
A very simple example:
type Vector3dUnity
float x=1.0
float y=1.0
float z=1.0
end type
Vector3dUnity v 'initially all 0
v={} ' v.x=1.0 v.y=1.0 v.z=1.0
v={ y=2.5 } ' v.x=1.0 v.y=2.5 v.z=1.0
Unfortunately, this enhancement breaks the syntax of single liner unions, and though they are very rarely used, it affects a number of examples which use the aptly named
chaos.inc in one place:
type pix byte r,g,b,a = int c
'should now be expanded to:
type pix
byte r,g,b,a
=
int c
end type
So I have attached the corrected
chaos.inc below
https://github.com/Charles-Pegge/OxygenBasic/blob/master/OxygenProgress.zip