Topic: Clearing text using component count

Hi,
I have a form with multiple text boxes and memos. Is there any way I can clear all existing text from both the text boxes and memos before closing the form using a component count. Any advice would be appreciated.

Thanks Terry

Re: Clearing text using component count

Hello.


Example:

procedure frmEmployee_OnClose (Sender: string; Action: string);
var
    i,c: integer;
begin
    c := frmEmployee.ComponentCount-1;
    for i := 0 to c do
    begin
        if frmEmployee.Components[i] is TdbEdit then TdbEdit(frmEmployee.Components[i]).Clear;
        if frmEmployee.Components[i] is TdbMemo then TdbMemo(frmEmployee.Components[i]).Clear;
    end;
end;
Dmitry.