VARKON Version 1.16 1997-09-08

> ## inbin - Procedure

> Read binary data from a file
> Description
> Reads unformatted binary data from a file. An optional parameter can be used to specify conversion between 16/32 bit integers, 32/64 bit floats and variable length strings.
> Syntax
> inbin(f, data, bytecount)

> FILE | f;
> anytype | data;
> INT | bytecount;

> Principal parameters

> f | - The name of a filevariable accociated with a file open for read or update (R or U)
> data | - A variable to recieve the data to be read.

> Optional parameters

> bytecount | - The number of bytes to be read. Only valid for INT/FLOAT or STRING variables.

> Comments

> If no bytecount is specified inbin() reads as many bytes as needed for the actual type of the variable ie. 4 bytes for an INT, 8 bytes for a FLOAT and so on. If a bytecount is specified, inbin() reads the number of bytes specified and converts the data to the size used by VARKON. An 8 bit integer (1 byte) or a 16-bit integer (2 bytes) for example may be read into a VARKON INT which is 32 bits. A 32 bit float (4 bytes) may be read into a VARKON FLOAT which is 64 bits.

VARKON Homepage | Index