This is at the start of the code:
How do I determine the version of Lazarus?
Replace the showmessage with a writeln. TS is not using Lazarus so showmessage is not available.Besides that, if you run the application in a terminal window it should show the exception no matter what.