Board index » delphi » "Form" as parameter of a procedure

"Form" as parameter of a procedure

How can I use:

procedure MyProc(aForm : TObject);
begin
        ...

        "aForm".Memo.Text := 'some text';

        ...
end;

???

The Form is the aprametre of  my procedure !

Thx all, Machaon

 

Re:"Form" as parameter of a procedure


"Machaon" <machao...@wanadoo.fr> schrieb im Newsbeitrag
news:akt680$huh$1@wanadoo.fr...

Quote
> How can I use:

> procedure MyProc(aForm : TObject);
> begin
>         ...

>         "aForm".Memo.Text := 'some text';

>         ...
> end;

> ???

> The Form is the aprametre of  my procedure !

> Thx all, Machaon

Use something like this:

 procedure MyProc(aForm : TMyForm);
 begin
         ...
         aForm.Memo.Text := 'some text';
         ...
 end;

where TMyForm is the class of the form
that contains Memo. Look for a line like

  TMyForm = class(TForm)

or similar in the unit for the form to find
out what your class is called.
Ciao, Uli.

Other Threads