Skip to content

#IFCLASS

#IfClass

See Also: Define Command, #IFDEF

Purpose

The #IfClass command allows you to specify conditionally compiled code based on the class of a symbol.

Syntax

#IfClass {symbol} {class-list}
{code to compile if symbol is in the class-list}
#Else
{code to compile if symbol is not in the class-list}
#EndIf

Argument Explanation

  • symbol: The identifier that you wish the compiler to check. It can be any valid token or identifier.
  • class-list: The list of class-checking characters that the {symbol} is tested against.

What It Does

Compiles the true code if the class of {symbol} is in the {class-list}; otherwise, it compiles the false code.

Classes

Character Meaning
c Constant
f File element
w Window (obsolete)
v Variable
G Group {options} or {indicators}