$TYPECHECK ON

STRUCT zing
	x as integer
'	y as integer
'	zz(1 to 3) as single		'only four bytes ended up being allocated here (just pointer?)
END STRUCT

DIM Myzing as zing
 STRUCT MyType
		a as integer
		b as single
		c as byte
		d(5) as integer			'only four bytes ended up being allocated here too (just pointer?)
		z as zing				'this won't work
'		x as integer			'*** these 3 lines are added instead ...
		y as integer			'*** you must literally paste the nested structure
		zz(1 to 3) as single	'*** into the final (highest heirarchy) structure
      Name AS STRING*30
      Phone AS STRING*8
      Age AS INTEGER
  END STRUCT

  DIM Person AS MyType
      Person.Name = "Joe"
      Person.Phone = "555-5555"

DIM MyUDT as MyType

MyUDT.z.x = 1

  DIM Mem AS QMemoryStream

	Mem.WriteUDT(Person)
'	ShowMessage str$(Mem.Pointer)			'works
'	ShowMessage str$(sizeof(Person))		'works
'	Person.z.zz(1) = 2.23451				'doesn't work!!
'	ShowMessage str$(Person.z.zz(1))		'doesn't work!!!
	Person.zz(1) = 2.23451					'now it works
	ShowMessage str$(Person.zz(1))			'now it works
	Person.c = 127
'	showmessage str$(varptr(Person.c))		'doesn't work, but need this to work for COM interface!!
	showmessage str$(@Person.c)				'works to get the value of the variable
	ShowMessage str$(Mem.Pointer + SizeOf(integer)+ SizeOf(single)) 'works but manually need to calculate offset!!!

