Sets a file pointer to a new position in an ASCII or binary file.
- Type: File The file in which to set the pointer.
- Type: Integer The position at which to set the pointer.
The following example sets a pointer at position 20 in a file and truncates the file at the pointer position. The WRITEMODE Function (File) enables a file named C:\TestFolder\TestFile.txt to open in write mode. The SEEK function sets a pointer at position 20 in the file and then the TRUNC Function (File) truncates the contents of the file at the pointer position. This example assumes that you have created the text file C:\TestFolder\TestFile.txt.This example requires that you create the following variable in the C/AL Globals window.
TestFile.WRITEMODE(TRUE); TestFile.OPEN('C:\TestFolder\TestFile.txt'); TestFile.SEEK(20); TestFile.TRUNC;