unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end; TTest=class
public
a:integer;
b:string; constructor Create();
end;var
Form1: TForm1;implementation{$R *.dfm}
constructor TTest.Create();
begin
inherited Create();
a:=1;
b:='1';
end;
procedure TForm1.Button1Click(Sender: TObject);
var
test1:TTest;
begin
test1.Create();
label1.Caption:=test1.b;
end;end.
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end; TTest=class
public
a:integer;
b:string; constructor Create();
end;var
Form1: TForm1;implementation{$R *.dfm}
constructor TTest.Create();
begin
inherited Create();
a:=1;
b:='1';
end;
procedure TForm1.Button1Click(Sender: TObject);
var
test1:TTest;
begin
test1.Create();
label1.Caption:=test1.b;
end;end.
解决方案 »
- 调试问题!!
- 我在DELPHI中如何打开其它程序的东西???
- delphi连接数据库的方式有多少种?
- 大家来帮帮忙,分不会少的噢!!!
- 关于硬件接口编程问题
- listview中出现EStringListError with message 'List index out of bounds(-1)'错
- 哪位高手能帮我的忙呢?万分的感谢!
- 当用mailto发送一个邮件时,如何通过程序生成邮件的主体和正文的内容
- 左晚下载了delphi6,刚装好,猛一看确实加了好多东西,但更增加了我的迷茫,这么多新东西怎么去掌握,是否有了较好的参考资料和书籍?
- 请问侯捷的书哪里有下载?
- 如何打印数据库的全部记录,不用快速报表
- 请问adostoredproc和storedproc的区别!
test1.free;
test1:TTest;
begin
test1 := Ttest.Create();
try
label1.Caption:=test1.b;
finally
test1.free;
end;
end;