ENet Xojo plugin

ENetPacket.CString Method

Gets or sets a String value at a given offset that will be terminated with 0 character.

CString(
   offset as Integer) as String

CString(
   offset as Integer
   assigns value as String)

Parameters

offset
Offset is in bytes from the beginning of the ENetPacket.
value (assignment parameter)
The value to be set

Returns

String
The value at the given offset empty string if the ENetPacket is dead because it has already been sent.

Remarks

Note that for example UTF8 strings might be more bytes than characters, so always use LenB to figure out how many bytes the string occupied and add one to that for the 0 termination.

Information on encoding is not preserved, so if your working with UTF8 strings then you need to restore the encoding type by manually defining it by using DefineEncoding on the receiver side.

See Also

ENetPacket Class