# IF

#### Syntax <a href="#syntax.23" id="syntax.23"></a>

**IF**(*condition; thenExpression; elseExpression*)

* *condition* - the condition which is evaluated *- **Value type**: boolean*
* *thenExpression* - expression which is evaluated if *condition* is *true* - ***Value type**: any*
* *elseExpression* - expression which is evaluated if *condition* is *false - **Value type**: any (optional, default: empty)*

#### Return <a href="#return.2" id="return.2"></a>

The function returns the result of the evaluated *then*- or *elseExpression*.&#x20;

#### Remarks <a href="#remarks.20" id="remarks.20"></a>

* The function can be called with multiple *condition*/*thenExpression* parameter pairs as well. In this case, the evaluation of the functions stops after the first condition which is *true*.\
  If none of the conditions is true, *elseExpression* is evaluated.

#### Examples

<figure><img src="https://content.gitbook.com/content/4X6nN2wTlDsVpd8P1WDM/blobs/3XDK4STwakqtTAocSQd3/grafik.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/4X6nN2wTlDsVpd8P1WDM/blobs/anitnOu5ZMNhNyfPVFRb/grafik.png" alt=""><figcaption></figcaption></figure>

In this case, after clicking on the button, table3 is filled with the information if the values of table4 are positive, negative or zero. \
The IF function is used here with 5 parameter, and the result is used to fill a table widget.&#x20;

<figure><img src="https://content.gitbook.com/content/4X6nN2wTlDsVpd8P1WDM/blobs/ZO9dw3tbdM4rSJ97UzV7/grafik.png" alt=""><figcaption></figcaption></figure>
