May I ask You a question?
Ok, I created a new project, then I added to this project a new unit (unit2.pas). I put some components on a form (i.e. memo, label etc.). Now i want to create a procedure in unit2 which will check if there is a specified name component on a main form. But I don't want to add unit1 (main unit) to uses list in unit2. I try to build more universal procedure, which i can use in other programs, so i want to use list of main form components as a parameter of my procedure.
Now I have something like that:
In unit2.pas:
procedure CheckComponents(var list:TComponent);
var _m:TComponent;
begin
_m:=list.FindComponent('memory');
if (_m is TMemo) then showmessage('ok');
end;
then I use this in main unit:
CheckComponent(components);
But it does not work, the "unit1.pas(34,19) Error: Wrong number of parameters specified for call to "GetComponent" error raise.
So how to put a list of any form components into a procedure to work on it?
I will be grateful
Thank you!
Best regards