If

Summary

Allows conditional evaluation of config.

The following types of expressions are supported:

  • Boolean Values
  • Comparisons
  • Presence in ArrayOfStrings
NOTE: Precise syntax is currently limited. Only single expressions using previously defined variables are supported. More flexible syntax (literals and compound expressions) will be added in the future.

Boolean Values

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

Examples:

If( .MyBoolean ) { // Evaluated if .MyBoolean == true }
If( !.MyBoolean ) { // Evaluated if .MyBoolean == false }
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

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 }
Presence in ArrayOfStrings

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

Examples:

If( .String in .ArrayOfStrings ) { // Evaluated if .StringA is found in .ArrayOfStrings }
If( .StringA not in .ArrayOfStrings ) { // Evaluated if .StringA 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 }