If

Summary

Allows conditional evaluation of config.

The following types of expressions are supported:

  • Boolean Values
  • Comparisons
  • Presence in ArrayOfStrings
  • Compound boolean expressions of above three types
NOTE: Literal of ArrayOfStrings is not supported so far.

Boolean Values

Variables of type Boolean can be tested for their truth value.

Examples:

Priority Operator
1 !
2 &&, ||
If( .MyBoolean ) { // Evaluated if .MyBoolean == true }
If( !.MyBoolean ) { // Evaluated if .MyBoolean == false }
If( .MyBoolean == false ) { // Evaluated if .MyBoolean == false }
If( .MyBoolean && .AnotherBoolean ) { // Evaluated if both .MyBoolean and .AnotherBoolean are true }
If( .MyBoolean || .AnotherBoolean ) { // Evaluated if at least one of .MyBoolean and .AnotherBoolean is true }
If( .Bool1 && .Bool2 && .Bool3 ) { // Evaluated if all those three variables are true }
If( !.Bool1 && .Bool2 && .Bool3 ) { // Evaluated if .Bool is false, but .Bool2 and .Bool2 are true // Note: '!' has the top priority }
Comparisons

Two variables of the same type can be compared by the following operators.

Operator Description String Int Bool
== Equal
!= Not Equal
< Less Than
<= Less Than Or Equal
> Greater Than
>= Greater Than Or Equal
NOTE: Comparison should be surrounded by round brackets (braces) in a compound expression.

Examples:

If( .StringA == .StringB ) { // Evaluated if strings are equal }
If( .IntA >= .IntB ) { // Evaluated if first integer is greater than or equal to second integer }
If( .BoolA != .BoolB ) { // Evaluated if booleans are not equal }
If( ( 1 <= .Int ) && ( .Int <= 10 ) ) { // Evaluated if the value of .Int is between 1 and 10. }
Presence in ArrayOfStrings

ArrayOfString variables can be checked for the presence of another String, using either a single String or another ArrayOfString.

NOTE:Presence in ArrayOfStrings should be surrounded by round brackets (braces) in a compound expression.

Examples:

If( .String in .ArrayOfStrings ) { // Evaluated if .StringA is found in .ArrayOfStrings }
If( "StringLiteral" not in .ArrayOfStrings ) { // Evaluated if "StringLiteral" is not found in .ArrayOfStrings }
If( .ArrayOfStrings1 in .ArrayOfStrings2 ) { // Evaluated if any String in .ArrayOfStrings1 is found in .ArrayOfStrings2 }
If( .ArrayOfStrings1 not in .ArrayOfStrings2 ) { // Evaluated if no String in .ArrayOfStrings1 is found in .ArrayOfStrings2 }
If( !.Bool && ( .ArrayOfStrings1 not in .ArrayOfStrings2 ) ) { // Evaluated if .Bool is false and no String in .ArrayOfStrings1 is found in .ArrayOfStrings2 }