Thanks for your quick reply!
The code compiles and works in Delphi perfectly as I have writen it in Delphi first. Now I'm trying to make it also compatible with FPC .I hope this is the last adjustment to the code I'll have to made so I can finaly finish my article.