公共函数如何调用? 独立出一个unit,多的话直接写成dll! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在一个单元中写 在你的程序中加入 uses commdcu(公共单元); 对,也就是在其他调用这个函数所在的单元中增加 uses XXXXXXXX为公共函数所在的单元名称 写在public里,然后在别的窗体里uses一下函数所在单元就可以调用了 unit commdcu;interfaceimplementationfunction tt(strValue: String): Boolean;begin Result:=True;end;end.但在别的地方use commdcu后,仍不能访问tt,为什么? 如果函数数量非常少的话,比如1到2个,你可以将它们写在implementation下面,如:implementation //函数声明 function MyFunction(s1, s2: String): String;{$R *.dfm}function MyFunction(s1, s2: String): String;begin // your Codeend; 对不起,写错了,应该在implementation上面: //函数声明 function MyFunction(s1, s2: String): String;implementation{$R *.dfm}function MyFunction(s1, s2: String): String;begin // your Codeend; 加上函数声明后,在最后一行end.处,提示:BEGIN expected but END found 数据库中性别列数据类型为为false true 怎么在显示时改为男女 关于数组的一个问题 全国Delphi工资调查. 关于画图的问题,虚线,半圆等 读不到串口数据? [版务贴] 怀疑倒分,请extcsdn和ppppok进来解译一下,三天之内无答复的,送交大版主封杀. 如何求两个时间之间的跨度,并显示为 :x年x月 。是个长度 不是日期 简单的数据库问题对菜鸟也很难,请大侠来帮我 我的程序打包后 放在那里呀?用delphi带的打包工具??? xp menu在delphi中该如何用? 请问哪个按钮控件上可以放ICON类型的图标,怎样放??? 如何获得当前活动的窗口,并关掉多余的以打开的窗口?
在你的程序中加入
uses
commdcu(公共单元);
XXXX为公共函数所在的单元名称
begin
Result:=True;
end;end.但在别的地方use commdcu后,仍不能访问tt,为什么?
如:
implementation
//函数声明
function MyFunction(s1, s2: String): String;
{$R *.dfm}function MyFunction(s1, s2: String): String;
begin
// your Code
end;
function MyFunction(s1, s2: String): String;
implementation{$R *.dfm}function MyFunction(s1, s2: String): String;
begin
// your Code
end;