Difference between revisions of "BINREAD()"

From Recital Documentation Wiki
Jump to: navigation, search
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
==Class==
 
Binary File Access
 
 
 
 
==Purpose==
 
==Purpose==
 
Function to read a character string from a binary file
 
Function to read a character string from a binary file
Line 32: Line 28:
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital Server, Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:Binary File Access]]
 
[[Category:Binary File Access]]
 
[[Category:Binary File Access Functions]]
 
[[Category:Binary File Access Functions]]

Latest revision as of 16:07, 26 November 2009

Purpose

Function to read a character string from a binary file


Syntax

BINREAD([<expN1>,<expN2>])


See Also

BIN2I(), BIN2L(), BIN2W(), BINCLOSE(), BINCREATE(), BINOPEN(), BINSEEK(), BINWRITE(), FREAD(), FREADSTR(), I2BIN(), L2BIN()


Description

The BINREAD() reads a character string from a binary file that was opened with the BINCREATE() or BINOPEN() functions. The <expN1> is the file descriptor which was returned when the file was opened with either the BINCREATE() or BINOPEN() functions. The <expN2> value represents the number of bytes to read. The BINREAD() function reads the specified number of bytes from the file starting at the current position of BINSEEK(). BINREAD() returns the character string in the specified length of <expN2> if successful, or a string of length zero if unsuccessful. The binary conversion functions may be used in conjunction with the binary file functions.


Example

fd = binopen("file.obj")
count = binread(fd, 4)
count = bin2l(count)
count = l2bin(count + 1)
binseek(fd, 512, 0)
binwrite(fd, count)
binclose(fd)


Products

Recital Server, Recital