A "normal" Delphi snippet:
Procedure help_me1(Sender: TObject);
BEGIN
{100 lines of code}
END;
Procedure help_me2(Sender: TObject);
BEGIN
{100 lines of copy and paste code}
END;
How can I make this so that I end up with ONE procedure with 100 lines of code?
Procedure much_reuseable_code(choice:BYTE);
BEGIN
{100 lines of code}
END;
Procedure help_me1(Sender: TObject);
BEGIN
much_reuseable_code(1);
END;
Procedure help_me2(Sender: TObject);
BEGIN
much_reuseable_code(2);
END;
--In old days this was the way to do it, but the Sender: TObject makes it much harder.
I would really appreciate any help in regards to this.
Preferably more than one solution if there are several ways of bypassing the problem.
Thanks in advance.
M.