unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
Recaa=record
aa:string;
bb:integer;
cc:double;
end;
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
test:Recaa;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
test.aa:='easyboot';
test.bb:=10;
test.cc:=100.10;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ShowMessage(test.aa+' '+floatTostr(test.cc));
FillChar(test,SizeOf(test),0);
ShowMessage(test.aa+' '+floatTostr(test.cc));
end;
end.
结构体清空的例子
最新推荐文章于 2023-08-10 14:57:40 发布