|
In computing, IIf (an abbreviation for Immediate if〔(【引用サイトリンク】title=How to Use the IIf() (Immediate If) Function )〕) is a function in several editions of the Visual Basic programming language and ColdFusion Markup Language (CFML), and on spreadsheets that returns the second or third parameter based on the evaluation of the first parameter. It is an example of a conditional expression, which is similar to a conditional statement. ==Syntax== The syntax of the IIf function is as follows: IIf(''expr'', ''truepart'', ''falsepart'') All three parameters are required: * ''expr'' is the expression that is to be evaluated. * ''truepart'' defines what the IIf function returns if the evaluation of ''expr'' returns true. * ''falsepart'' defines what the IIf function returns if the evaluation of ''expr'' returns false. Many languages have an operator to accomplish the same purpose, generally referred to as a conditional operator (or, less accurately, as a ternary operator); the best known is ?:, as used in C, C++, and related languages. Some of the problems with the IIf function, as discussed later, do not exist with a conditional operator, because the language is free to examine the type and delay evaluation of the operands, as opposed to simply passing them to a library function. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「IIf」の詳細全文を読む スポンサード リンク
|