Well, first up, welcome to PGD Polar.

I'm no FreePascal expert, having never used it, but what you've got is pretty standard Pascal so I should be able to help... unfortunately, I can't because I can't see anything wrong with the code.

So, is it an error you're getting or is it a warning... possibly something like 'The value assigned to X is not used'?

Whatever, we will need more information, mainly the exact messages returned by the compiler if we are to help you.