Sets the EOD (end of data) value of a buffer.
BinaryEodSet( handle, offset )
(i) handle: handle of buffer.
(i) offset: desired offset to set the end-of-data value to.
(i) previous value.
Use this function to update the EOD value. This can be done when data at the end of a buffer is to be discarded, or when the buffer has been modified by an external program - such as via a DllCall.
; This function extracts the first line from the ; config.sys file and writes it to a new file. fs1 = FileSize("C:\CONFIG.SYS") binbuf1 = BinaryAlloc( fs1 + 100) BinaryRead(binbuf1, "C:\CONFIG.SYS") a = BinaryIndex(binbuf1, 0, @CRLF, @FWDSCAN) ; we just found the end of first line a = a + 2 ; add 2 to add the crlf BinaryEodSet(binbuf1, a) BinaryWrite(binbuf1, "firstlin.txt") binbuf1 = BinaryFree(binbuf1) Message("BinaryEODSet", "Done.")
Binary Operations, BinaryAlloc, BinaryEodGet, BinaryIndex, DllCall