BinaryStream.ReadPString
From Xojo Documentation
Method
BinaryStream.ReadPString([Encoding as TextEncoding]) As String
Supported for all project types and targets.
Supported for all project types and targets.
Reads a Pascal string from the stream and returns it as a String.
Notes
The optional parameter Encoding enables you to specify the encoding to be defined on the returned string. Use the Encodings module to specify the text encoding. If you omit this parameter (or pass Nil), then the encoding of the returned string will be Nil.
If you read over the end of the stream you get an empty string returned from this method. No error and no exception. If you want to test for this error, you can check the EndOfFile, BytePosition, and Length properties.