# DEBUG > [HTML Version](debugsystemvariable.htm) _Rewritten December 2023_ The identifier DEBUG can be either a read-only system variable returning the debug level as set by [SET.LIT](set_lit.htm.md), or a standard variable, depending on the following: • If the /X:2 compiler switch is specified, then DEBUG is treated as the system variable, provided it has not been previously mapped as a regular user variable. • If the /DEBUG compiler switch is specified, then DEBUG is always treated as a read-only system variable whose value is 1. This is intended to allow an easy way of compiling a program in "debug mode". • If neither /X:2 nor /DEBUG switches specified, then DEBUG is treated as an ordinary variable. If not mapped and /M not specified, it will be auto-mapped like any other unmapped variable. **Example** if DEBUG then ? "--DEBUG level set to ";DEBUG else ? "--DEBUG not set" endif If the above program was named SHOWDEBUG and compiled using the /X:2 switch, then... .SET DEBUG .RUN SHOWDEBUG \-DEBUG level set to 1 .SET DEBUG 9 .RUN SHOWDEBUG \--DEBUG level set to 9 .SET NODEBUG .RUN SHOWDEBUG \--DEBUG not set If compiled without the /X:2 switch, DEBUG would be treated as an unmapped variable, either initialized to 0, or if /M specified, generating an unmapped variable error. If compiled with both the /DEBUG and /X:2 switches, then regardless of any prior SET DEBUG statement, the result would be... .RUN SHOWDEBUG --DEBUG level set to 1 **Comments** Regardless of the compiler switches, DEBUG acts like a variable and not a symbol, and thus cannot be tested by the ++IFxxx [Conditional Compilation](conditionalcompilation.htm.md) directives. **See Also** • [SET.LIT](set_lit.htm.md) • [DEBUG ](debug-statements.htm.md)[Statements](debug-statements.htm.md) • [COMPIL.LIT](compil_lit.htm.md)