Difference between revisions of "BINWRITE()"

From Recital Documentation Wiki
Jump to: navigation, search
(Class)
 
Line 1: Line 1:
 
 
 
==Purpose==
 
==Purpose==
 
Function to write an expression to a binary file
 
Function to write an expression to a binary file
Line 30: 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:06, 26 November 2009

Purpose

Function to write an expression to a binary file


Syntax

BINWRITE(<expN>,<expC>)


See Also

BIN2I(), BIN2L(), BIN2W(), BINCLOSE(), BINCREATE(), BINOPEN(), BINREAD(), BINSEEK(), FWRITE(), I2BIN(), L2BIN()


Description

The BINWRITE() is used to write a character expression to a binary file, and returns the number of bytes written. The <expC> specifies the character expression to write to the binary file. The <expN> is the file descriptor of the file to write to. The file descriptor is obtained when the binary file is opened, as the return value from either the BINCREATE() or BINOPEN() functions. The BINWRITE() function writes the character expression starting at the position returned by the BINSEEK() function. The binary conversion functions may be used in conjunction with all 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