MemoryBlock.Byte

From Xojo Documentation

Method

MemoryBlock.Byte(Offset as Integer) As integer

Supported for all project types and targets.

Gets or sets the passed byte value. Returns an integer. Offset is in bytes from the beginning of the MemoryBlock.

Sample Code

The following code stores character byte values in a MemoryBlock and displays it as a String:

Var m As New MemoryBlock(12)
m.Byte(0) = 72
m.Byte(1) = 101
m.Byte(2) = 108
m.Byte(3) = 108
m.Byte(4) = 111
m.Byte(5) = 32
m.Byte(6) = 87
m.Byte(7) = 111
m.Byte(8) = 114
m.Byte(9) = 108
m.Byte(10) = 100
m.Byte(11) = 33

Val hello As String = m.StringValue(0, m.Size) // Hello World!