Returns the offset of the free byte just after the last byte of stored data.
BinaryEodGet( handle )
(i) handle: handle of buffer.
(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.
; 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.")
Binary Operations, BinaryAlloc, BinaryEodSet, BinaryIndex, BinaryIndexNC