Create an if-then-elif-then*-else clause.
Namespace: NetricsServerInterface
Assembly: NetricsServerInterface (in NetricsServerInterface.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Shared Function CreateIfElseIf( _ ByVal ParamArray sub_exprs As NetricsPredicate() _ ) As NetricsPredicate |
C# |
---|
public static NetricsPredicate CreateIfElseIf( params NetricsPredicate[] sub_exprs ) |
C++ |
---|
public: static NetricsPredicate CreateIfElseIf( ... array<NetricsPredicate>^ sub_exprs ) |
J# |
---|
public static NetricsPredicate CreateIfElseIf( NetricsPredicate[] sub_exprs ) |
JScript |
---|
public static
function CreateIfElseIf( ParamArrayAttribute sub_exprs : NetricsPredicate[] ) : NetricsPredicate |
Parameters
- sub_exprs
- the sub-expressions for the if function.
Remarks
The predicate if function allows an arbitrary number of conditional clauses. The generalized form of the if function is:
![]() | |
---|---|
if { [cond,result,]* default-value } |
The "cond" expressions are evaluated in order, the "result" value associated with the first one that evaluates to true is returned, if none evaluate to true, "default-value" is returned.
All of the "cond" expressions must evaluate to a boolean value. All of the "result" and the "default-value" expressions must evaluate to the same type. If a single value is given it is treated as a "default-value" with no "cond" "result" clauses. I.e. a single value is just returned as the result of the if function.
This method allows for creation of the generalized if clause by allowing any number of arguments to be passed in.