相关资料:
1.https://zhidao.baidu.com/question/283124338.html
1 unit Unit1; 2 3 interface 4 5 uses 6 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 7 Dialogs, Menus, StdCtrls; 8 9 type10 TForm1 = class(TForm)11 Button1: TButton;12 Edit1: TEdit;13 procedure Button1Click(Sender: TObject);14 private15 { Private declarations }16 public17 FInteger :Integer;18 FBool :Boolean;19 FDouble: Double;20 { Public declarations }21 end;22 23 var24 Form1: TForm1;25 26 implementation27 28 { $R *.dfm}29 30 procedure TForm1.Button1Click(Sender: TObject);31 var32 I: Integer;33 begin34 I := 0;35 I := SizeOf(FInteger);36 ShowMessage(IntToStr(I)); //437 I := SizeOf(FBool);38 ShowMessage(IntToStr(I)); //139 I := SizeOf(FDouble);40 ShowMessage(IntToStr(I)); //841 I := SizeOf(Button1);42 ShowMessage(IntToStr(I)); //443 I := SizeOf(Edit1);44 ShowMessage(IntToStr(I)); //4 45 I := SizeOf(Form1);46 ShowMessage(IntToStr(I)); //447 I := SizeOf(TForm1);48 ShowMessage(IntToStr(I)); //449 I := Self.InstanceSize;50 ShowMessage(IntToStr(I)); //88851 end;52 53 end.