Hi all,
I would like to know if it is possible to modify bytes from a binary file using runrev ?
What I want to do for example is ... I load a binary file (which is a pure binary files filled with bytes),
then once loaded into a buffer I want to modify the 4th byte (offset $4) from the value it currently has (let say $80) into another value (let say $81 hex value)
then save this buffer into a new binary file...
How would you achieve that ?
Any help is greatly appreciated.
Thanks.
How to modify bytes in a binary file with RunRev
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: How to modify bytes in a binary file with RunRev
Hello,
Robert
Sure.I would like to know if it is possible to modify bytes from a binary file using runrev ?
Load the file into a buffer, convert each character to a the hex value by using the baseConvert function. Make your changes and write the file back.How would you achieve that ?
Robert
Re: How to modify bytes in a binary file with RunRev
Thanks rrobert,
could you provide couple sample code to do that ? I am really novice in runrev
TIA.
could you provide couple sample code to do that ? I am really novice in runrev

TIA.
Re: How to modify bytes in a binary file with RunRev
you can also use the binarencode and binarydecode stuff, but if you're just beginning with rev, i suggest to try something else then binary stuff first.
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode