Topic: Uses and multiple instances of an event

Trying to make use of 'USES' function as I start to like it.
I tried to implement multiple instances of 'Form1_OnShow' event as:

procedure Form1_OnShow (Sender: string; Action: string);
begin
Frm1onShow1;  // Calendar
Frm1onShow2;  // General + RTF Font
Frm1onShow3;  // password
Frm1onShow4; // Menu

with the following .pas files:
'calend.pas',  // Calendar code
'passw.pas',  // Password code
'menu.pas';  // Menu code


However, couldn't get it working. It's coming up with script error saying 'BEGIN expected at ...'
Please see the attached app.

Post's attachments

Attachment icon MiniJournal_02.zip 99.35 kb, 34 downloads since 2024-09-05 

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

Re: Uses and multiple instances of an event

Each .pas file must end with a section

begin

end.

For example
calc.pas

function mult(x, y: integer): integer;
begin
result := 0;
if (x <> 0) and (y <> 0) then result := x * y;
end;

begin

end.

Be careful when using this method. At the compilation stage, MVD does not indicate in which module the error occurred. I would advise you to do everything in the default script at the debugging and writing stage and only at the final stage distribute everything among modules.

Re: Uses and multiple instances of an event

Hi Sparrow,


Thank you very much for the advice....  and thank you for your time.
Truly appreciated....

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