4

How can I append text to a file?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Brett
  • 121
  • 1
  • 2
  • 4

2 Answers2

8

You can use the SaveStringToFile() function to append text to a file.

mghie
  • 32,028
  • 6
  • 87
  • 129
Kyle Alons
  • 6,955
  • 2
  • 33
  • 28
4
fileName := ExpandConstant('{pf}\{#MyAppName}\batch.bat');
SetArrayLength(lines, 3);
lines[0] := 'echo hello';
lines[1] := 'pause';
lines[2] := 'exit';
Result := SaveStringsToFile(filename,lines,true);
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992