ReadBinary
Reads a binary value of a specified type from a file.
Syntax
ReadBinary(fileID, valueType)
Parameters
Parameter |
Type |
Description |
---|---|---|
fileID |
number |
File ID received from |
valueType |
string |
Binary type. Should be |
Return
The value read from the file.
Examples
Python
import nex
# open binary file in read mode
file = nex.OpenFile(r"C:\Data\binaryfile.dat", "r")
# read short (2-byte signed) value
shortValue = nex.ReadBinary(file, "short")
nex.CloseFile(file)
NexScript
% open binary file in read mode
file = OpenFile("C:\Data\binaryfile.dat", "r")
% read short (2-byte signed) value
shortValue = ReadBinary(file, "short")
CloseFile(file)