IF

The IF function can be used to define a conditional expression.

Format

IF(EXPR1: EXPR2, EXPR3, EXPR4)

Description

If the value of EXPR1 is less than zero, the IF function evaluates to EXPR2.

If the value of EXPR1 is equal to zero, the IF function evaluates to EXPR3.

If the value of EXPR1 is greater than zero, the IF function evaluates to EXPR4.

Arguments

EXPR1
The first expression which is checked against zero.
EXPR2
The second expression, which is evaluated and whose value is returned as a value of the IF function, if EXPR1 is less than zero.
EXPR3
The third expression, which is evaluated and whose value is returned as a value of the IF function, if EXPR1 is equal to zero.
EXPR4
The fourth expression, which is evaluated and whose value is returned as a value of the IF function, if EXPR1 is greater than zero.

Example

<Force_Vector_TwoBody
id                   = "30305"
label                = "Name_of_the_Force element"
type                 = "ForceOnly"
i_marker_id          = "30301038"
j_floating_marker_id = "70000004"
ref_marker_id        = "30101010"
fx_expression        = IF(VARVAL(30300900):0,0,ARVAL(30300800)*VX(10301030)/VARVAL(30300900))"
fy_expression        = "IF(VARVAL(30300900):0,0,-VARVAL(30300800)*VY(10301030)/VARVAL(30300900))"
fz_expression        = "0"
/>