E
ericmm
Unregistered / Unconfirmed
GUEST, unregistred user!
我在编写以下程序的时候:
procedure TForm1.OvalButton2Click(Sender: TObject);
var
week,ke,i,j:integer;
temps:string;
begin
Query1.sql.Text:='delete * from classtb';
Query1.ExecSQL;
Query1.close;
Query1.sql.Text:='insert into classtb(xinqi,keci,kecheng,jiaoshi) valuesa,:b,:c,:d)';
for i:=1 to 65 do
if ((i mod 13)<10)and ((i mod 13)>0) then
begin
week:=(i div 13)+1;
ke:=(i mod 13);
with Query1 do
begin
Parambyname('a').AsString:=IntToStr(week);
Parambyname('b').AsString:=IntToStr(ke);
temps:=TEdit(FindComponent('Edit'+IntToStr(i))).Text;
Parambyname('c').AsString:=temps;
case ke of
1,2: j:=10;
3,4: j:=11;
5,6,7: j:=12;
8,9: j:=13;
end;
showmessage(TEdit(FindComponent('Edit'+IntToStr(j+(i div 13)))).Text);
temps:=TEdit(FindComponent('Edit'+IntToStr(j+(i div 13)))).Text;
Parambyname('d').AsString:=temps;
end;
Query1.ExecSQL;
Query1.Close;
end;
end;
不知道是怎么回事,temps的值老是为空,但是TEdit(FindComponent('Edit'+IntToStr(j+(i div 13)))).Text的值不为空啊.这是怎么
回事啊?!!
procedure TForm1.OvalButton2Click(Sender: TObject);
var
week,ke,i,j:integer;
temps:string;
begin
Query1.sql.Text:='delete * from classtb';
Query1.ExecSQL;
Query1.close;
Query1.sql.Text:='insert into classtb(xinqi,keci,kecheng,jiaoshi) valuesa,:b,:c,:d)';
for i:=1 to 65 do
if ((i mod 13)<10)and ((i mod 13)>0) then
begin
week:=(i div 13)+1;
ke:=(i mod 13);
with Query1 do
begin
Parambyname('a').AsString:=IntToStr(week);
Parambyname('b').AsString:=IntToStr(ke);
temps:=TEdit(FindComponent('Edit'+IntToStr(i))).Text;
Parambyname('c').AsString:=temps;
case ke of
1,2: j:=10;
3,4: j:=11;
5,6,7: j:=12;
8,9: j:=13;
end;
showmessage(TEdit(FindComponent('Edit'+IntToStr(j+(i div 13)))).Text);
temps:=TEdit(FindComponent('Edit'+IntToStr(j+(i div 13)))).Text;
Parambyname('d').AsString:=temps;
end;
Query1.ExecSQL;
Query1.Close;
end;
end;
不知道是怎么回事,temps的值老是为空,但是TEdit(FindComponent('Edit'+IntToStr(j+(i div 13)))).Text的值不为空啊.这是怎么
回事啊?!!