源程序为
 while not table1.Eof do
      begin
        if table1.FieldByName('szg').AsBOOLEAN:= true
         then
          table2.FieldByName('双职工').AsString:='是';
        if table1.FieldByName('szg').ASBOOLEAN:= false
          then
            table2.FieldByName('双职工').AsString:='否';
      end;
编译提示错误为type of the expression must be boolean
table1式dbf中的表,sag字段在当中格式标为L型

解决方案 »

  1.   

    if table1.FieldByName('szg').AsBOOLEAN:= true//:=改成=  if table1.FieldByName('szg').ASBOOLEAN:= false//同样
      

  2.   

    从错误上看
    'szg'字段不是boolean类型,为L型(是不是long型?),所以不能转换为boolean,即AsBOOLEAN失败
      

  3.   

    :=是界定符,是用来赋值的,
    if 后面表达式用布而型,pascal中用=
      

  4.   

    问题应该解决了吧,如果不行就
    if table1.FieldByName('szg').AsBOOLEAN then //true
    if not table1.FieldByName('szg').AsBOOLEAN then //false
    这样程序运行会快的多,养成这个好习惯。
    如果还不行,就是你的AsBOOLEAN函数不是boolean型,应该不可能。试一下