我用的是fr252,请问在Text editor(既insert rectangle object组件)中如何写代码?
比如:
在Text editor窗口分上下两个子窗口,我在上面的窗口中写入:[hsl]
下下面的窗口中写入:
begin
if ADOQuery1.DF_GF0='' then
   qfje:='0'
else
   qfje:=ADOQuery1.DF_GF0;
hsl:=ADOQuery1.DF_GF0/(qfje+ADOQuery1.DF_GF0)*100;
end这样程序运行时报错如下:
an error occured during calculating
[hsl]
Report:frReport1
Objec:Memo22
could not convert variant of type(String) into type(Double)
请问这段代码该怎么写?

解决方案 »

  1.   

    begin
    if [ADOQuery1.DF_GF0]='' then
       qfje:='0'
    else
       qfje:=[ADOQuery1.DF_GF0];
    hsl:=[ADOQuery1.DF_GF0]/(qfje+[ADOQuery1.DF_GF0])*100;
    end少了括号
      

  2.   

    TO:spiderzzl(毛毛鱼)
    我按你说的加上 括号后还是报同样的错误。
      

  3.   

    DF_GF0 是一个字段吧?
    改成[ADOQuery1."DF_GF0"]再试试
      

  4.   

    TO:spiderzzl(毛毛鱼)
    DF_GF0 是字段,但加双引号后还是报同样的错误。
      

  5.   

    hsl:=[STRTOFLOAT(ADOQuery1.DF_GF0)]/(qfje+[STRTOFLOAT(ADOQuery1.DF_GF0)])*100;
    试试