S
stonehuang
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm12.suiEdit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
count_CC1:integer;
TempInt:real;
begin
if key=13 then
begin
if dm.ADOTable_CC1.Active then
count_CC1:=dm.ADOTable_CC1.RecordCount;
dm.ADOTable_CC1.Append;
dm.ADOTable_CC1.FieldByName('ID').AsString:=inttostr(count_CC1+1);
dm.ADOTable_CC1.FieldByName('JQID').AsString:=dm.ADOTable_Machine.FieldValues['ID'];
dm.ADOTable_CC1.FieldByName('CPID').AsString:=dm.ADOTable_CP.FieldValues['CPID'];
dm.ADOTable_CC1.FieldByName('Date').AsDateTime:=form10.DateTimePicker1.Date;
dm.ADOTable_CC1.FieldByName('BanCi').AsString:=form10.ComboBox3.Items[form10.ComboBox3.Itemindex];
dm.ADOTable_CC1.FieldByName('Name').AsString:=suicombobox1.Items[suicombobox1.Itemindex];
dm.ADOTable_CC1.FieldByName('Times').AsFloat:=strtofloat(suiedit1.Text);
dm.ADOTable_CC1.Post;
dm.ADOTable_CC1.Refresh;
end;
TempInt:=StrTofloat(suiedit1.text);
sum:=sum+TempInt;
form10.suiEdit10.Text:=floattostr(sum);
end;
例如輸入30,但傳給form10.suiedit10.text的值為33﹐而實際數据庫裏又為30﹐請問出錯在哪里呢﹖
Shift: TShiftState);
var
count_CC1:integer;
TempInt:real;
begin
if key=13 then
begin
if dm.ADOTable_CC1.Active then
count_CC1:=dm.ADOTable_CC1.RecordCount;
dm.ADOTable_CC1.Append;
dm.ADOTable_CC1.FieldByName('ID').AsString:=inttostr(count_CC1+1);
dm.ADOTable_CC1.FieldByName('JQID').AsString:=dm.ADOTable_Machine.FieldValues['ID'];
dm.ADOTable_CC1.FieldByName('CPID').AsString:=dm.ADOTable_CP.FieldValues['CPID'];
dm.ADOTable_CC1.FieldByName('Date').AsDateTime:=form10.DateTimePicker1.Date;
dm.ADOTable_CC1.FieldByName('BanCi').AsString:=form10.ComboBox3.Items[form10.ComboBox3.Itemindex];
dm.ADOTable_CC1.FieldByName('Name').AsString:=suicombobox1.Items[suicombobox1.Itemindex];
dm.ADOTable_CC1.FieldByName('Times').AsFloat:=strtofloat(suiedit1.Text);
dm.ADOTable_CC1.Post;
dm.ADOTable_CC1.Refresh;
end;
TempInt:=StrTofloat(suiedit1.text);
sum:=sum+TempInt;
form10.suiEdit10.Text:=floattostr(sum);
end;
例如輸入30,但傳給form10.suiedit10.text的值為33﹐而實際數据庫裏又為30﹐請問出錯在哪里呢﹖