不同形式的呼叫程序 [英] Call procedures from different forms

查看:89
本文介绍了不同形式的呼叫程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用拉撒路(Lazarus),并且有一个名为TForm1的表格和单元名称的Unit 1.

通过这种方式,我必须创建另一个名为TForm2的表单,并且在其中有按钮(Button1).按下时,它必须从第一种形式调用mergeDATfile(a:shortint);.

我该怎么办?

解决方案

显而易见的解决方案是将MergeDatFile函数移到一个通用单元中,然后这两个表单单元都可以使用它.

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.

How could I do it?

解决方案

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

这篇关于不同形式的呼叫程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆