This string function determines the location of the special folder for temporary files. This depends on the running operating system and the logged on user.
function TempDir: string;
The location is determined from the operating system API using the ShellFolder function.
begin memo1.lines.SaveToFile(TempDir+'\test.txt'); showMessage('Filed under: '+TempDir+'\test.txt'); end;
Rules to understand the script can be found here.
In this example, it is assumed that an element memo1 was positioned on one of the tapes in the report design. The content of this Memo1 element is then created as an ASCII file with the name TEST.TXT in the special folder for temporary files of the PC. A corresponding screen message is also displayed.
Always use the TempDir folder when you need to save temporary files.
ShowMessage shows: Filed under: C:\Docum~\claus\LOCAL~1\Temp\test.txt