The position in the file to start reading data.
Set the position in the file.
The .SEEK() method sets the position of the file pointer to a Byte Offset (measured in bytes) in relation to the beginning of the file specified by the file object pointer. This function is used to read and write data at a particular location in a data file.
This script will change four characters in the Defaults file. The old text "VAR3" will be changed to the new text "XXXX".
file_pointer = FILE.open("c:\a5\defaults.txt", FILE_RW_SHARED)
Read the third group of 4 characters.
file_pointer.seek(8) text = file_pointer.read(4) trace.writeln("Old value: " + text)
Write the four characters at the same position.
Read the third group of 4 characters to see the change.
file_pointer.seek(8) text = file_pointer.read(4) trace.writeln("New value: " + text) file_pointer.close()