且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

vb中iif的目的是什么

更新时间:2022-05-30 05:21:09

它允许生成一个值的简洁布尔逻辑表达式

It allows for a concise boolean logic expression which produces a value

Dim value = Iif(someTest, trueValue, falseValue)

如果没有 IifIf 运算符,这必须扩展为一组更繁琐的语句

Without the Iif or If operator this has to be expanded into a more combursome set of statements

Dim value;
If someTest Then
  value = trueValue
Else
  value = falseValue
End If