L
l0f
Unregistered / Unconfirmed
GUEST, unregistred user!
我在UNIT2中定义了一个类
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
Type Tmyclass = Class
private
msg:String;
Public
procedure Showmsg(var s:String);
end;
implementation
procedure Tmyclass.Showmsg(var s:String);
begin
msg:=s;
showmessage(msg);
end;
end.
在UNIT1中调用,可是出错!
procedure TForm1.Button1Click(Sender: TObject);
var test:Tmyclass;
begin
test:=Tmyclass.Create;
test.Showmsg('sdf');//这里出错无法赋值
end;
=============
请问错在那里了?
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
Type Tmyclass = Class
private
msg:String;
Public
procedure Showmsg(var s:String);
end;
implementation
procedure Tmyclass.Showmsg(var s:String);
begin
msg:=s;
showmessage(msg);
end;
end.
在UNIT1中调用,可是出错!
procedure TForm1.Button1Click(Sender: TObject);
var test:Tmyclass;
begin
test:=Tmyclass.Create;
test.Showmsg('sdf');//这里出错无法赋值
end;
=============
请问错在那里了?