structure from xojo.core.mutableMemoryBlock

Can anybody provide a way to pull a structure from a xojo.core.mutableMemoryBlock (or xojo.core.memoryBlock)? Before you could use something like:

myStructure.stringValue(false) = oldFrameworkMemoryblock

Trying to get this new framework down… and I’m losing hair over here. I’ve been at this almost 2 hours now, and am about to throw in the towel. Thanks!

Nevermind… there’s a little gem (structure.byteValue) that isn’t documented in the Language Reference or shows up in the autoComplete while using the structure. It’s buried in the online developer’s documentation site (which is awesome, btw). I made what I need work utilizing that.

The usual way to get a structure is to assign the MemoryBlock to a Ptr, then deference. For example:

[code]Structure Point
x as Integer
y as Integer
End Structure

dim m as new Xojo.Core.MutableMemoryBlock(8)
m.Int32Value(0) = 43
m.Int32Value(4) = 101
dim p as Ptr = m.Data
dim pt as Point = p.Point(0)[/code]

[quote=201908:@Charles Yeomans]The usual way to get a structure is to assign the MemoryBlock to a Ptr, then deference. For example:

[code]Structure Point
x as Integer
y as Integer
End Structure

dim m as new Xojo.Core.MutableMemoryBlock(8)
m.Int32Value(0) = 43
m.Int32Value(4) = 101
dim p as Ptr = m.Data
dim pt as Point = p.Point(0)[/code][/quote]

Works beautifully…

Thanks, Charles!