这是俺的代码,都是0
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 }
function MyFun1(x:integer):integer;
function MyFun2(var x:integer):integer;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TForm1 }
function TForm1.MyFun1(x: integer): integer;
begin
result:=x;
x:=100;
end;
function TForm1.MyFun2(var x: integer): integer;
begin
result:=x;
x:=100;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
a:integer;
begin
ShowMessage(IntToStr(MyFun1(a)));
ShowMessage(IntToStr(MyFun2(a)));
end;
end.
大家找找哪里的毛病?55555555