Parser Conditionals

In a settings file, you can use if and endif commands to parse different sections of the code based on the result of an expression or option.

Use the following comparason operators:

= Equal
! Not Equal
< Less Than (Real/Integer comparason only)
> Greater Than (Real/Integer comparason only)

Conditionals take the following format (note that the if and endif commands must begin with the type of comparason symbol that you want to use - ! for int, ~ for real, $ for string, ? for bool):

# Integer Comparason

! if (myint < 2+otherint)

# Do something

! endif


# Real Comparason

~ if (myreal > otherreal)

# Do something

~ endif



# String Comparason
# Note that you must use square brackets to define
# A string variable, to distinguish it from normal text

$ if ([mystr] ! some text)

# Do something

$ endif



# Boolean Comparason

? if (mybool)

# Do something

? endif


? if (mybool = (NOT otherbool))

# Do something

? endif

Conditionals are also nestable - for example:

! if (something > 10)

  ? if (option1)

    ? if (option2)
      ? if (option3)
        # Do something
      ? endif
    ? endif

    ? if (option2)
      # Do Something
    ?endif

  ? endif

! endif