I get an error on line 5 >>> unit1.pas(17,3) Error: An interface, helper or Objective-C protocol or category cannot contain fields
Wow, we're bouncing all over the forum.
Please keep to one topic.
This code wasn't a complete unit.
You would need to put this in your own form-unit or create a proper helper-unit.
(With unit at the top etc.)
O, and you're missing a ; at the end of line 5.
But you could also put all this in the implementation part.
The class defenition doesn't need to be at the top.