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