终于找到描述我的问题的方法了,朋友们,帮帮忙,我已经疯了,把这个代码复制到新建工程,增加一个按钮就就可以了
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
Type TRec = Record
a1 : Array[0..13] of Byte;
a2 : Integer;
a3 : Integer;
end;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
kankan : TRec;
suju : array[0..21] of byte;
begin
suju[0] := $0;
suju[1] := $0;
suju[2] := $0;
suju[3] := $0;
suju[4] := $0;
suju[5] := $0;
suju[6] := $0;
suju[7] := $0;
suju[8] := $0;
suju[9] := $0;
suju[10] := $0;
suju[11] := $0;
suju[12] := $0;
suju[13] := $0;
suju[14] := $0C;
suju[15] := $00;
suju[16] := $00;
suju[17] := $00;
suju[18] := $0B;
suju[19] := $00;
suju[20] := $00;
suju[21] := $00;
CopyMemory(@kankan,@suju[0],22);//Sizeof(kankan));
form1.Caption := inttostr(kankan.a2);
end;
end.