我的数据库是sql server 2000   sex 字段是  bit 型的  
    if   RadioButton1.Checked:=true  then
    query1.FieldByName('sex').AsBoolean := true
    else
    begin RadioButton2.Checked:=true  ;
    query1.FieldByName('sex').AsBoolean := false;
    end;
运行错误
[Error] zjyh.pas(136): ':=' expected but '=' found
[Fatal Error] money.dpr(10): Could not compile used unit 'zjyh.pas'

解决方案 »

  1.   

    错误代码很明显,[Error] zjyh.pas(136): ':=' expected but '=' found 
    改为:if   RadioButton1.Checked=true  then 
      

  2.   

    if RadioButton1.Checked then 
      query1.FieldByName('sex').AsBoolean := true 
    else 
    begin 
      RadioButton2.Checked := true; 
      query1.FieldByName('sex').AsBoolean := false; 
    end;
      

  3.   

    错误上已经告诉你了
    if   RadioButton1.Checked:=true  then 
    --》
    if   RadioButton1.Checked=true  then 
      

  4.   

      if   RadioButton1.Checked then 
        query1.FieldByName('sex').AsBoolean:=true 
      else 
        begin
          RadioButton2.Checked:=true; 
          query1.FieldByName('sex').AsBoolean:=false; 
        end;