I've been trying for hours with VarSetCapacity, NumPut and RawWrite to no avail.
I have a very small test file which contains 46 bytes:
I would like to write, say, 0xFF to the cell at offset 0x0A.
i.e the value 0x80 in cell 0x0A in the above image should change to 0xFF, without changing any of the other bytes around it.
My latest attempt:
Code: Select all
VarSetCapacity(byte , 1)
NumPut(0xFF, byte, 0, "Char")
file := FileOpen( "myfile.txt" , "w")
file.Pos := 0x0A
file.RawWrite(byte, 1)
file.close()