为什么会出错,函数的使用问题
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
procedure FormCreate(Sender: TObject);
function someDoit(i:Integer):Integer;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
p : Integer;
begin
p := someDoit(5);
Edit1.Text := IntToStr(p);
end;
function someDoit(i : Integer):Integer;
begin
Result := i+1;
end;
end.
---------------
DELPHI 7.0下调试
错误信息:
[Error] Unit1.pas(13): Unsatisfied forward or external declaration: 'TForm1.someDoit'
[Fatal Error] Project2.dpr(5): Could not compile used unit 'Unit1.pas'