我的程序编译和逻辑都没有问题,但运行过程中总出现错误提示,不知为何,请高手指点。(100分)

Y

yanke

Unregistered / Unconfirmed
GUEST, unregistred user!
if(D<dw) then
G:=(dw-D)*19*L*B+(19-10)*L*B*(lc-dw+D)
else
G:=(19-10)*L*B*lc;
//计算自重
for i:=1 to 15 do
begin
depth:=strtofloat(myEdit1.Text);
thick[1]:=depth[1];
thick[i+1]:=depth[i+1]-depth;
r:=strtofloat(myedit2.Text);
if depth< (D+lc) then
begin
Pcz:=r*thick;
Pcz1:=Pcz1+Pcz;
k:=k+1;
end
else
begin
exit;
showmessage(inttostr(k))
end;
if depth[k]<=dw then
Pcz1:=Pcz1+r[k+1]*(D+lc-depth[k])
else
Pcz1:=Pcz1+r[k+1]*(D+lc-depth[k])-10*(D+lc-dw);
end;
进行计算时出现以下提示语句,不知如何修正?
project cjjs has raised exception class econverterror
with message '''is not a valid floating point value,
process stoped, please use
step or run to continue.
 
strtofloat(myEdit1.Text)或strtofloat(myEdit2.Text)转换错误
你跟踪调试看看myEdit2.Text中的数据可不可以转换成浮点数
 
同意楼上的意见
 
数据类型不匹配,可能是在数据转换时strtofloat了一个非数字的字符串,例如:空格。
建议跟踪一下。
 
浮点运算错误!
 
顶部