Description | Same as a single-line If statement, except that the entire statement is evaluated as an expression, leaving only one of two values. | ||||||
Syntax | If test Then true_expression [Else false_expression] | ||||||
Parameters | The conditional If expression has the following parameters.
When test is true, then the value of true_expression is the result of the If expression. When the test is false (0 or null) the value of the false_expression is the result of the If expression. For example: @ANS = If {CHANGED} Then "YES" Else "NO" The dictionary record that contains the above code is used in a report that shows when a record has been changed. If the CHANGED field is not empty and contains anything other than a 0, then "YES" will be printed in the report. The conditional-expression If must be written on a single line. The Then and Else clauses may only contain an expression. | ||||||
Example | Function MAX (X,Y) MAX=If X>Y Then X Else Y Return MAX |