I have a form in Delphi including several TEdit boxes. I would like a way to check the validation all of the boxes kind of, currently I would have to have a boolean variable assigned to each TEdit. e.g.
Var
TEdit1Valid:boolean;
TEdit2Valid:boolean;
etc, etc for every TEdit on the form.
For the first method it would have to look something like this:
If TEdit1Valid then
ShowMessage('Your', Edit1.Name, 'is invalid');
etc, etc for each TEdit box.
This creates many variables and I was just wondering if there is a better way to do it. One idea I had is to assign a property called Valid to a TEdit, but I don't know how to do this. With this method I could then write an array of TEdits for each TEdit and execute the following
for I := 1 to High(EditList) do
begin
if EditList[I].Valid = false then
ShowMessage('Your ', EditList[I].Name, 'is invalid');
end
This is just an example bit of rough code that I just wrote and could use along with other things I could do iteratively like this. So could someone either suggest a good method of doing this or show me how to do the afore mentioned method.