BinaryFree

Frees a buffer previously allocated with BinaryAlloc.

Syntax:

BinaryFree( handle )

Parameters:

(i) handle: handle of buffer to free.

Returns:

(i)  returns 0.

 

Use this function to free a binary buffer previously allocated by the BinaryAlloc function. After freeing the buffer, no further operations should be performed on the buffer or its handle.

 

Example:


fs=FileSize("C:\CONFIG.SYS")
binbuf = BinaryAlloc(fs+100)
If binbuf == 0
   Message("Error", "BinaryAlloc Failed")
Else
   BinaryRead(binbuf, "C:\CONFIG.SYS")
   BinaryPokeStr(binbuf, fs, "DEVICE=C:\FLOOGLE.SYS%@crlf%")
   BinaryWrite(binbuf, "C:\CONFIG.SYS")
   binbuf=BinaryFree(binbuf)
EndIf
Message("BinaryFree", "Done.")
See Also:

Binary Operations, BinaryAlloc