Home Search

DriveWorks Pro 22
IfCondition

Send Feedback

IfCondition

Returns the first parameter if it satisfies the condition, otherwise the Default Value is returned.

Syntax

IfCondition( [Value], [Condition], [DefaultValue], [Ignore Whitespace] )

Where:

Value is the value to check against the condition.

Condition is the condition the value must satisfy.

DefaultValue is the value to return if the first value does not satisfy the condition.

Ignore Whitespace (optional) is True to ignore leading/trailing whitespace characters in text strings in the condition, otherwise False.

When Value is a long rule (such as a QueryData rule), and the required result when the Condition is matched is the result of the same rule, using IfCondition avoids having to enter the rule twice.

Examples

Rule

Meaning
IfCondition(LengthReturn,"<100",100)When the value coming from the form control Length matches the condition <100, the value of the form control will be returned. Otherwise 100 will be returned.

Comparing Values

OperatorMeaning
< Checks to see if the value is less than the value specified on the right hand side of the comparator.
<=Checks to see if the value is less than or equal to the value specified on the right hand side of the comparator.
>Checks to see if the value is greater than the value specified on the right hand side of the comparator.
>=Checks to see if the value is greater than or equal to the value specified on the right hand side of the comparator.
<>Checks to see if the value is not equal to the value specified on the right hand side of the comparator.
=Checks to see if the value is the same as the value specified on the right hand side of the comparator.