I have some code to reset the controls in my dialog:
procedure TForm2.OKButtonClick(Sender: TObject);
Form2.Hide;
LabeledEdit1.Clear;
LabeledEdit2.Clear;
LabeledEdit3.Clear;
ComboBox1.ItemIndex := -1;
ActiveControl := LabeledEdit1;
end;
But because this procedure has tonnes of other code, I thought that to improve readability, I'd write a custom procedure called
ResetForm and call this procedure in the OKButtonClick procedure:
procedure ResetForm (Form: TForm);
begin
Form2.Hide;
LabeledEdit1.Clear;
LabeledEdit2.Clear;
LabeledEdit3.Clear;
ComboBox1.ItemIndex := -1;
ActiveControl := LabeledEdit1;
end;
I get error from this (Identifier not found) - I think I have the parameters wrong, but I can't find anything on Google. What should the parameters be?