User Manual
MCP Series
Brushed DC Motor Controllers
MCP Series User Manual
185
#IFDEF .. #ENDIF
#IFDEF name
..optional code..
#ENDIF
..rest of program..
Example
Compiles the code (up to #ENDIF) if the constant or variable (name) is dened, or if the label
appears previously in the code.
temperature var byte
#IFDEF temperature
..optional code..
#ENDIF
..rest of program..
This will compile “optional code” because “temperature” has been dened.
#IFNDEF .. #ENDIF
#IFNDEF name
..optional code..
#ENDIF
..rest of program..
Example
Compiles the code between #IFNDEF and #ENDIF only if the constant or variable has not been
dened, or the label has not been previously used in the program. In effect, it is the opposite of
#IFDEF.
temperature var byte
#IFDEF temperature
..optional code..
#ENDIF
..rest of program..
This will NOT compile “optional code” because “temperature” has been dened.