delphi中自定义过程问题
1、在delphi中自定义过程时是否都要先声明过程?声明过程必须在interface下的type中定义吗?能否在其它地方声明?若能有什么不同?最好举个例子说明。
2、下面这个程序怎样修改才正确?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure show(j:integer);
begin
showmessage(inttostr(j));
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
i:=1;
show(i); //此处错误,错误信息为:Too many actual parameters
end;
end.