H
hopegood
Unregistered / Unconfirmed
GUEST, unregistred user!
TSqxPersistent = class(TPersistent)
private
FInt: Integer;
FStr: String;
FStr1: String;
public
constructor Create;
end;
constructor TSqxPersistent.Create;
begin
FInt := 774;
FStr := 'sqxsqxsqx_ fksljfkafdjsfd';
FStr1 := 'sqx';
end;
procedure TForm1.Button1Click(Sender: TObject);
var
lSQXPersistent: TSQXPersistent;
x: pShortstring;
begin
lSQXPersistent := TSQXPersistent.create;
x := pShortstring(Pinteger(Integer(lSQXPersistent)+8+sizeof(Integer))^);
showmessage(x^);//应该是‘sqx’,但为什么是‘qx’
end;
private
FInt: Integer;
FStr: String;
FStr1: String;
public
constructor Create;
end;
constructor TSqxPersistent.Create;
begin
FInt := 774;
FStr := 'sqxsqxsqx_ fksljfkafdjsfd';
FStr1 := 'sqx';
end;
procedure TForm1.Button1Click(Sender: TObject);
var
lSQXPersistent: TSQXPersistent;
x: pShortstring;
begin
lSQXPersistent := TSQXPersistent.create;
x := pShortstring(Pinteger(Integer(lSQXPersistent)+8+sizeof(Integer))^);
showmessage(x^);//应该是‘sqx’,但为什么是‘qx’
end;