Search code examples
delphilazarus

Call procedures from different forms


I am using Lazarus and I have a form called TForm1 and the unit name's Unit 1. Inside here I have a procedure called mergeDATfile(a:shortint); that makes some stuff.

By the way I had to create another form called TForm2 and inside this I have button (Button1). When it is pressed, it must call mergeDATfile(a:shortint); from the 1st form.

enter image description here

How could I do it?


Solution

  • The obvious solution is to move the MergeDatFile function into a common unit which can then be used by both form units.