BinaryStream.ReadSingle

From Xojo Documentation

Method

BinaryStream.ReadSingle() As Double

Supported for all project types and targets.

Reads a word from the stream and returns it as a Double.

Notes

If you read over the end of the stream you get zero 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.

Sample Code

Var num As Single
Var readFile As FolderItem = GetOpenFolderItem("text/plain")
If readFile <> Nil Then
Var readStream As BinaryStream = BinaryStream.Open(readFile, False)
num = readStream.Single
End If