# if (if/then) processing code

The if processing code is used in dictionary
attributes 7 and 8 (conversion and correlative) to generate values
based on results of evaluation of expression according to the rules
of a-correlative construction.

The if processing code is a stand-alone
version of the if conditional allowable within
an a-correlative. If the condition evaluates to true (nonzero) the
a-correlative following then is executed. If there
is no then clause a null value is returned on true.

If the condition evaluates to 0 (false), the else clause is taken. Multiple complex conditionals can be constructed
by using end to close the current if clause and associate else with the prior if clause.

| System Processors | Select, Update, List |
| --- | --- |
| Code Type | Attribute Defining |
| Dictionary Attributes | Input Conversion, Output Conversion, Correlative |

## Syntax

```
if condition{then a-correlative} {else a-correlative} {end}
```

## Example(s)

```
if 2#4 then 4:’**’:2
```

```
if 14["1","3"]=’sco’ then 17
```

## See also

- [a (algebraic) processing code](https://d3codex.com/processingcodes/a-algebraic-processing-code/)
- [Processing codes overview](https://d3codex.com/processingcodes/processing-codes-overview/)

---
Source: https://d3codex.com/processingcodes/if-if-then-processing-code/ - part of the D3Codex reference.
