1 //Delphi 函数-IIF 2 // 实例-ChkValue := IIF(TCheckBox(tsPzJz.Controls[i]).Checked, '1', '0'); 3 function IIF(lExp: boolean; vExp1, vExp2: variant): variant; overload; 4 begin 5 if lExp then 6 Result := vExp1 7 else 8 Result := vExp2; 9 end;
1 //Delphi 函数-IIF 2 // 实例-ChkValue := IIF(TCheckBox(tsPzJz.Controls[i]).Checked, '1', '0'); 3 function IIF(lExp: boolean; vExp1, vExp2: variant): variant; overload; 4 begin 5 if lExp then 6 Result := vExp1 7 else 8 Result := vExp2; 9 end;