# $IFDEF directive

The $IFDEF directive tests for the definition of an identifier in the compiler symbol
 table.

## Syntax

```
 $IFDEF identifier statements
 {$ELSE statements}
 $ENDIF
```

## Parameter(s)

| identifier | Specifies the symbol to be tested. If the symbol is defined in the symbol table (by $DEFINE), the statements following the identifier are executed. If the symbol is not defined in the symbol table (by $DEFINE), the statements in the $ELSE clause are executed if specified. The $ENDIF directive is required. |
| --- | --- |
| $ELSE | (Optional) If the symbol is not defined, the statements in the $ELSE clause are executed if specified. |
| $ENDIF | (Required) The $ENDIF directive marks the end of the $IFDEF directive. |

## Example(s)

**Example 1**

 PLATFORM

```

 001 $DEFINE PLATFORM.D3
```

 **Example 2**

 TEST.IFDEF

```

 001 $INCLUDE PLATFORM
 002 $IFDEF PLATFORM.D3
 003 USER.INFO = OCONV(&#39;&#39;, &#39;U50BB&#39;)
 004 $ELSE
 005 CALL !GET.USERS(&#39;&#39;, &#39;&#39;, &#39;&#39;,USER.INFO,&#39;&#39;)
 006 $ENDIF
 007 PRINT USER.INFO
```

## See also

- [$DEFINE directive](https://d3codex.com/pickbasic-flashbasic/define-directive/)
- [Compiler directives](https://d3codex.com/pickbasic-flashbasic/compiler-directives/)

---
Source: https://d3codex.com/pickbasic-flashbasic/ifdef-directive/ - part of the D3Codex reference.
