MemoryBlock.PString

From Xojo Documentation

Method

MemoryBlock.PString(Offset as Integer) As String

Supported for all project types and targets.

Returns a String, up to 255 characters. The first byte is the length of the string. Offset is in bytes from the beginning of the MemoryBlock.

Sample Code

The following example stores a string in a MemoryBlock and displays it:

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