I didn’t try that, but when I saw the “TApplication theApp();” command I realised that I deleted “theApp.Run()” in the end of the code as I thought it wasn’t important. turns out it is. I put the line before the “delete f;” and now it works. Thank you for your help.
(It is still not closing. I have to press ctrl+c to get back to entering commands but as the other Analysing tools have that as well I am sure there is something in the Internet that will help me.)