This string function determines the location of the desktop. This depends on the running operating system and the logged on user.
function DesktopDir: string;
The location is determined from the operating system API using the ShellFolder function.
begin memo1.lines.SaveToFile(DesktopDir+'\test.txt'); showMessage('Filed under: '+DesktopDir+'\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 on the desktop of the PC. A corresponding screen message is also displayed.
ShowMessage shows: Filed under: C:\Documents and settings\Klaus\desktop\test.txt