新
新兵
Unregistered / Unconfirmed
GUEST, unregistred user!
我的代码
procedure TForm1.Button1Click(Sender: TObject);
var
a : Pint64;
begin
New(a);
self.OraQuery1.Close;
self.OraQuery1.SQL.Text := 'select jgbm a,jgmc b from zzjgdmb where jglx = 0 and dwlbdm in(1) and xs=1 order by px';
self.OraQuery1.Open;
// a = 330799000000,330799000001,330799000002
if Not self.OraQuery1.IsEmpty then
begin
while Not self.OraQuery1.Eof do
begin
a^ := self.OraQuery1.fieldbyname('a').Asinteger;
self.ComboBox1.Items.AddObject(self.OraQuery1.fieldbyname('b').AsString,Tobject(a));
self.OraQuery1.Next;
end;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
b : int64;
begin
self.Memo1.Text :='';
b := Pint64(self.ComboBox1.Items.Objects[self.ComboBox1.ItemIndex])^;
self.Memo1.Text := inttostr(b);
end;
memo取出的值不对,为什么
procedure TForm1.Button1Click(Sender: TObject);
var
a : Pint64;
begin
New(a);
self.OraQuery1.Close;
self.OraQuery1.SQL.Text := 'select jgbm a,jgmc b from zzjgdmb where jglx = 0 and dwlbdm in(1) and xs=1 order by px';
self.OraQuery1.Open;
// a = 330799000000,330799000001,330799000002
if Not self.OraQuery1.IsEmpty then
begin
while Not self.OraQuery1.Eof do
begin
a^ := self.OraQuery1.fieldbyname('a').Asinteger;
self.ComboBox1.Items.AddObject(self.OraQuery1.fieldbyname('b').AsString,Tobject(a));
self.OraQuery1.Next;
end;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
b : int64;
begin
self.Memo1.Text :='';
b := Pint64(self.ComboBox1.Items.Objects[self.ComboBox1.ItemIndex])^;
self.Memo1.Text := inttostr(b);
end;
memo取出的值不对,为什么