The if() statement is a built-in function which expects three arguments. The first argument is a Boolean value. The second and the third one can be of any data type. If the first argument is equal to logical true, the second argument will be evaluated and its result will be returned. If not, the third argument will be evaluated and its result will be returned, e.g.,
a = 2; b = 4; min = if (a < b, a, b);
In this example a new variable named min which contains the minimum of the two given variables is defined.
Robert Klima 2003-02-06