Append procedure
Prototype: |
procedure Append(f: integer); |
|
Description: |
The Append procedure opens the specified file for writing - data is appended to the existing content. |
|
Syntax: |
Append(f); |
|
Part |
Description |
|
f |
The identifier of the file as returned by the AssignFile function |
|
Return value: |
none |
|
Example:
var
fileID: integer;
fileName: string;
begin
fileName:= 'listOfTrees.txt';
fileID:= AssignFile(fileName);
Append(fileID); // this line open the file for writing and appends data to the end of file
WriteLn(fileID, 'picea, malus'); // this line writes a new values in the file
CloseFile(fileID);
end.
Output:
the text file before call the example
![]()
the text file after call the example
new values are appended in the end
![]()
if exists a new line in the end in the file (before call the example)
See also:
AssignFile; Reset; Rewrite; Append; WriteLn; ReadLn; EOF; CloseFile; DeleteFile; SaveStringToFile; SaveStringToFileAsUTF8
© 2024 IFER-Monitoring and Mapping Solutions