为了账号安全,请及时绑定邮箱和手机立即绑定

如果想使用delphi来调用函数过程,求问该怎么做?

如果想使用delphi来调用函数过程,求问该怎么做?

ITMISS 2021-07-22 20:15:17
unit button;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, StdCtrls;typeTForm1 = class(TForm)Button1: TButton;Label1: TLabel;procedure FormCreate(Sender: TObject);procedure Button1Click(Sender: TObject);procedure Label1Click(Sender: TObject);private{ Private declarations }public{ Public declarations }end;varForm1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);function GetFileCount(srcPath, srcFileName: string): Integer;varFileRec: TSearchrec;currPath: string;beginif srcPath[Length(srcPath)] <> '\' then srcPath := srcPath + '\';currPath := srcPath + '*.*';Result := 0;if FindFirst(currPath, faAnyFile, FileRec) = 0 thenrepeatif ((FileRec.Attr and faDirectory) <> 0) and(FileRec.Name <> '.') and(FileRec.Name <> '..') thenbeginResult := Result + GetFileCount(srcPath + FileRec.Name, srcFileName);end elseif AnsiCompareText(srcFileName, FileRec.Name) = 0 thenResult := Result + 1;until FindNext(FileRec) <> 0;end;beginend;procedure TForm1.Button1Click(Sender: TObject);beginfunction GetFileCount(srcPath, srcFileName: string): Integer;end;procedure TForm1.Label1Click(Sender: TObject);beginlabel1.caption:='333333'end;end.如何在button1窗体下调用函数过程
查看完整描述

2 回答

?
当年话下

TA贡献1890条经验 获得超9个赞

procedure proA();
begin
end;
procedure buttonclick(sender:Tobject);
begin
proA();
end;

查看完整回答
反对 回复 2021-07-29
  • 2 回答
  • 0 关注
  • 409 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信