Brass Core Plugins

if

Selects statements for execution based on the results of a series of conditionals.

Syntax

.if condition1
	[evaluated if condition1 met]
.elseif condition2
	[evaluated if condition2 met]
.else
	[evaluated if no conditions met]
.endif

Remarks

You may nest conditional statements.

Statements following an else or elseif directive are only executed if no previous conditions have evaluated to true.

ifdef, ifndef, elseifdef and elseifndef check if the following symbol is defined (ie, ifdef x is functionally equivalent to if defined(x)).

Examples

x = 10 \ y = 20

.if x > y
    .echoln "X is greater than Y."
.endif
age = 18

#if age > 300
    .echoln "Sorry, we don't serve spirits."
#elseif age < 18
    .echoln "You are below the legal drinking age."
#elseif age < 21
    .echoln "Can I see some ID, please?"
#else
    .echoln "Here, have a pint."
#endif