I feel like this should be easy, but google is totally failing me at the moment. I want to open a file, or create it if it doesn\'t exist, and write to it.
The followin
You can use the FileExists function and then use Append if exist or Rewrite if not.
AssignFile(logFile, 'Test.txt'); if FileExists('test.txt') then Append(logFile) else Rewrite(logFile); //do your stuff CloseFile(logFile);