Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: BinaryReplace NULL 00 BinaryPeekHex BinaryPokeHex ChrStringToHex
Lots of other stuff happens -- the buffer gets placed in a file, the user edits it, and it gets read back in to a buffer.
How do I get "[NULL]" back to a NULL character? Using "" as the replacement string seems to be deleting the search string.
;Detlev Dalitz ;DD.20100715.2255.CEST intBBSize = 100 hdlBB = BinaryAlloc (intBBsize) intBytesWritten = BinaryPokeStr (hdlBB, 0, StrFill ("[NULL] ABC", intBBSize)) strHex = BinaryPeekHex (hdlBB, 0, BinaryEodGet (hdlBB)) strHex = StrReplace (strHex, ChrStringToHex ("[NULL]"), "00") BinaryEodSet (hdlBB, BinaryPokeHex (hdlBB, 0, strHex)) hdlBB = BinaryFree (hdlBB)
Or the ever tricky one-liner.....
;Detlev Dalitz ;DD.20100715.2255.CEST BinaryEodSet (hdlBB, BinaryPokeHex (hdlBB, 0, StrReplace (BinaryPeekHex (hdlBB, 0, BinaryEodGet (hdlBB)), ChrStringToHex ("[NULL]"), "00")))
Article ID: W17679
Filename: BinaryReplace With NULL Characters.txt
File Created: 2010:07:16:11:21:08
Last Updated: 2010:07:16:11:21:08