Topic: Events

Is it possible to use more than one instances of the same event?


For example, Form1_OnShow event is many times associated to different scripts. Trying to fit all different scripts under one Form1_OnShow event is not a straight forward job for me. I like to to keep all script blocks separately so that I can locate them easily.


Can I use multiples of  Form1_OnShow  by naming them Form1_OnShow , Form1_OnShow 2, Form1_OnShow 3 etc and putting then on MVD Object Inspector / Events / OnShow:   Form1_OnShow , Form1_OnShow 2, Form1_OnShow 3 separated with commas or whatever the correct character.


Perhaps there is another way?

Adam
God... please help me become the person my dog thinks I am.

Re: Events

It's not problem if you put different scripts to one event

procedure Form1_OnShow (Sender: string; Action: string);
begin
   // script1
   // ...


   // script2
   // ...


   // script3
   // ...
end;


or you can use procedures for that:


procedure Form1_OnShow (Sender: string; Action: string);
begin
   OnShow1;
   OnShow2;
   OnShow3;
end;

procedure OnShow1;
begin
  // some script
end;

procedure OnShow2;
begin
  // some script
end;

procedure OnShow3;
begin
  // some script
end;
Dmitry.

Re: Events

Thanks a lot Dmitry................

Adam
God... please help me become the person my dog thinks I am.