I have two components created dynamically, a button (btnEnter) and an edit (edtID)- where the user will enter their user ID. What I want is for the program to verify whether the user has entered a valid ID when they have clicked the button.
The code I have:
1)When the objects are created
with btnEnter do
{edit properties such as caption, etc}
OnClick := ValidateID;
2)The procedure is declared as follows:
procedure ValidateID (Sender : TObject);
What I would like to do is pass the text in the edit through the procedure as a parameter, so that the procedure will be able to manipulate the text and determine whether it is valid or not.
So what I tried, but didn't work was:
procedure ValidateID (Sender : TObject; sID : string);
with btnEnter do
OnClick := ValidateID(edtID.Text);
Would really appreciate if someone could help me with this. Thanks