First, declare a StringList Field variable in your Form class (it should be a public variable if you plan to use it in other forms of your application too):
Then create the StringList in the OnCreate event handler (of your main form):
Whenever you create a temporary file during the program execution, you should not forget to add it to this list of temporary files, for example:
Then, when the program terminates (preferably in the OnDestroy event handler of your main form), the collected temporary files are automatically deleted, and the allocated StringList object is removed from the memory:
That's how easy it is to manage your temporary files!
If you have any questions about this topic or about any other programming topic, contact me at my website:
No comments:
Post a Comment