Sets the end-of-file (EOF) position for a specified file to the current position of the file pointer.
Kernel.bdh
FEOFSet( in hFile: number ): boolean;
true if successful
false otherwise
Parameter | Description |
---|---|
hFile | Valid handle to an open file. This handle must have been returned from a previous call to FOpen. |
dcltrans transaction TMain var hFile : number; sOutput : string; begin // create new file and write string to file FOpen(hFile, "c:\\temp\\dummyfile.txt", OPT_FILE_ACCESS_READWRITE, OPT_FILE_CREATE); sOutput := "Hello world!"; FWrite(hFile, sOutput, Strlen(sOutput)); write("new file created"); writeln; // set file position to end of word "Hello" FCurrentPositionSet(hFile, 5, OPT_FILE_BEGIN); write("current position set to 5"); writeln; // set EOF to current position FEOFSet(hFile); write("EOF set, file contains only the word 'Hello'"); writeln; // close file FClose(hFile); write("file closed"); writeln; end TMain;
new file created current position set to 5 EOF set, file contains only the word 'Hello' file closed