How do I do this?
If I have a structure and a BinaryStream, how do I read from the BinaryStream and place its contents into a struct?
[code]Structure TestStruct
Dim something As UInt32
Dim somethingElse as Single
Dim anotherThing as UInt16
End Structure
Dim bs as BinaryStream = BinaryStream.Open(f,False)
if f<>Nil then
Dim myStruct as TestStruct
// Get the contents from bs into TestStruct
end if[/code]
I don’t want to have to do:
myStruct.something = bs.ReadUInt32
myStruct.somethingElse = bs.ReadSingle
myStruct.anotherThing = bs.ReadUInt16
The struct I am working with has a boat-load of members… there has to be a slick way of doing this in Xojo?
thanks…