MemoryBlock.LittleEndian
From Xojo Documentation
Property (As Boolean )
aMemoryBlock.LittleEndian = newBooleanValue
or
BooleanValue = aMemoryBlock.LittleEndian
Supported for all project types and targets.
or
BooleanValue = aMemoryBlock.LittleEndian
Supported for all project types and targets.
Sets the endianness of a MemoryBlock. The default is the endianness of the platform on which the code is being compiled.
Sample Code
Var mb1 As New MemoryBlock(2) // defaults to Little Endian = True on all platforms
mb1.Int8Value(0) = 1
mb1.Int8Value(1) = 2
Var firstUInt16 As Int16
firstUInt16 = mb1.UInt16Value(0)
// firstUInt16 = (256 * 2) + (1 * 1) = 513
mb1.LittleEndian = False
Var secondUInt16 As Int16
secondUInt16 = mb1.UInt16Value(0)
// secondUInt16 = (256 * 1) + (1 * 2) = 258
mb1.Int8Value(0) = 1
mb1.Int8Value(1) = 2
Var firstUInt16 As Int16
firstUInt16 = mb1.UInt16Value(0)
// firstUInt16 = (256 * 2) + (1 * 1) = 513
mb1.LittleEndian = False
Var secondUInt16 As Int16
secondUInt16 = mb1.UInt16Value(0)
// secondUInt16 = (256 * 1) + (1 * 2) = 258