BinaryEodGet

Returns the offset of the free byte just after the last byte of stored data.

Syntax:

BinaryEodGet( handle )

Parameters:

(i) handle: handle of buffer.

Returns:

(i)  offset: of the free byte just after the last byte of stored data.

 

Use this function to determine the beginning of the free area just past the already initialized data in a buffer. This value is automatically set by any Binary function that modifies the buffer.

 

Example:


; This example adds three lines to the end of the
; config.sys file.
;
fs1 = FileSize( "C:\CONFIG.SYS" )
binbuf1 = BinaryAlloc( fs1 + 100 )
BinaryRead( binbuf1, "C:\CONFIG.SYS" )
a = BinaryEodGet( binbuf1 )
BinaryPokeStr( binbuf1, a, "REM ADDING FIRST NEW LINE TO END%@CRLF%")
a = BinaryEodGet( binbuf1 )
BinaryPokeStr( binbuf1, a, "REM ADDING SECOND LINE TO END%@CRLF%" )
a = BinaryEodGet( binbuf1 )
BinaryPokeStr( binbuf1, a, "REM ADDING THIRD LINE TO END%@CRLF%")
BinaryWrite( binbuf1, "C:\CONFIG.SYS")
BinaryFree( binbuf1 )
Message("BinaryEODGet", "Done.")
See Also:

Binary Operations, BinaryAlloc, BinaryEodSet, BinaryIndex, BinaryIndexNC