Function: IIf Edit
IIf makes conditional statements terser. PHP comparison to VB:
// PHP $data = $expr ? truePart : falsePart ' VB Data = IIf(expr, truePart, falsePart)
IIf(Expression, TruePart, FalsePart)
If expression is true TruePart is returned, otherwise FalsePart is returned
If you put calls to functions in the True or False parts those functions will be called even if the results of that function are not returned by the condition. The IIf is a function and all parts are evaluated first and then the results are passed to the IIf. Based on the conditional expression the result of either the true or the false part is returned.
In VB.NET this function returns an Object type and if you have option strict turned on, you will need to convert the results to the actual type of the variable you are trying to put the data into.