LISTSERV Maestro 11.1-2 Help Table Of Contents

Calculation Formulas

Back to Calculation Formulas Overview
Back to Functions Overview


Function "If"

If(condition, value1, value2)

Function: Evaluates the "condition" and returns either the "value1" (if the condition is "true") or the "value2" (if the condition is "false").

Return-Type: Depends on "value1" and "value2" (see below).

Arguments:
condition - Type Boolean: The condition to evaluate.
value1 - can be of any type (see below): The value to return if the condition evaluates to "true".
value2 - can be of any type (see below): The value to return if the condition evaluates to "false".

Note: Even though "value1" and "value2" can be of any type, the types of these two values must either be the same, or one type must be convertible into the other. If both types are the same, then this is also the return type of the function. If the types are different, but one type can be converted into the other type, then this other type is the return type of the function (even if the value with the first type should be selected by the condition).
See also: Automatic Type-Conversion

Examples:
If(&VALUE; > 15, "greater than 15", "not greater than 15")
If(&VALUE; + 20 = 50, 50, 0)

© 2002-2023 L-Soft Sweden AB. All rights reserved.