> For the complete documentation index, see [llms.txt](https://docs.videc.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.videc.de/acron-9.3/en/intro/funktionen/funk_logik.md).

# Functions Logic/Binary

The Logical and binary functions group contains functions with which you can link data in binary format and edit data. In the group you will find the following functions:

The first column of the table contains the name of the function as you enter it in an expression. The second column contains the data types of the argument(s), and the third column contains the data type of the function's return value.

| Function                         | arguments        | Return value: |
| -------------------------------- | ---------------- | ------------- |
| [BAnd](#func_band)               | (NUMBER, NUMBER) | NUMBER        |
| [BOr](#func_bor)                 | (NUMBER, NUMBER) | NUMBER        |
| [BXor](#func_bxor)               | (NUMBER, NUMBER) | NUMBER        |
| [Cond](#func_cond)               | (BOOL, ALL, ALL) | ALL           |
| [If](#func_if)                   | (BOOL, ALL, ALL) | ALL           |
| [IsEven](#func_iseven)           | (NUMBER)         | BOOL          |
| [IsNoValid](#func_isnovalid)     | (NUMBER)         | BOOL          |
| [IsOdd](#func_isodd)             | (NUMBER)         | BOOL          |
| [MakeDWord](#func_makedword)     | (NUMBER, NUMBER) | NUMBER        |
| [MakeSDWord](#func_makesdword)   | (NUMBER, NUMBER) | NUMBER        |
| [RotateLeft](#func_rotateleft)   | (NUMBER, NUMBER) | NUMBER        |
| [RotateRight](#func_rotateright) | (NUMBER, NUMBER) | NUMBER        |
| [ShiftLeft](#func_shiftleft)     | (NUMBER, NUMBER) | NUMBER        |
| [ShiftRight](#func_shiftright)   | (NUMBER, NUMBER) | NUMBER        |

It may be that not all the functions in this group are available in the application you are using. The application can deactivate individual functions or entire function groups in the Formula Editor. Those are normally functions which are not needed in the application, because a specific data type is not used for example.

## BAnd function <a href="#func_band" id="func_band"></a>

|               |                                                                                                                                                                             |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax:       | NUMBER BAnd (NUMBER, NUMBER)                                                                                                                                                |
| Parameters:   | <ul><li>1st value to be combined.</li><li>2nd value to be combined.</li></ul>                                                                                               |
| Return value: | Logical AND combination between the two arguments.                                                                                                                          |
| Description:  | <p>Combines the two numbers passed as arguments bitwise binary AND.</p><p>A fractional number as an argument is rounded down to the nearest integer before calculation.</p> |
| Example:      | <p>BAnd (1,1) = 1</p><p>BAnd (999, 200) = 192</p>                                                                                                                           |
| See also:     | [BOr function](#func_bor), [BXor function](#func_bxor)                                                                                                                      |

## BOr function <a href="#func_bor" id="func_bor"></a>

|               |                                                                                                                                                                            |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax:       | NUMBER BOr (NUMBER, NUMBER)                                                                                                                                                |
| Parameters:   | <ul><li>1st value to be combined.</li><li>2nd value to be combined.</li></ul>                                                                                              |
| Return value: | Logical OR combination between the two arguments.                                                                                                                          |
| Description:  | <p>Combines the two numbers passed as arguments bitwise binary OR.</p><p>A fractional number as an argument is rounded down to the nearest integer before calculation.</p> |
| Example:      | <p>BOr (1,1) = 1</p><p>BOr (999, 200) = 1007</p>                                                                                                                           |
| See also:     | [BAnd function](#func_band), [BXor function](#func_bxor)                                                                                                                   |

## BXOr function <a href="#func_bxor" id="func_bxor"></a>

|               |                                                                                                                                                                                      |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Syntax:       | NUMBER BXOr (NUMBER, NUMBER)                                                                                                                                                         |
| Parameters:   | <ul><li>1st value to be combined.</li><li>2nd value to be combined.</li></ul>                                                                                                        |
| Return value: | Logical exclusive OR combination between the two arguments.                                                                                                                          |
| Description:  | <p>Combines the two numbers passed as arguments bitwise binary exclusive OR.</p><p>A fractional number as an argument is rounded down to the nearest integer before calculation.</p> |
| Example:      | <p>BXOr (1,1) = 0</p><p>BXOr (999, 200) = 815</p>                                                                                                                                    |
| See also:     | [BAnd function](#func_band), [BOr function](#func_bor)                                                                                                                               |

## Cond function <a href="#func_cond" id="func_cond"></a>

|                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax:           | ALL Cond (BOOL, ALL \[, ALL])                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Parameters:       | <ul><li>Condition</li><li>Value in case the condition is TRUE.</li><li>Value in case the condition is FALSE.</li></ul><p>The data types for the second and third arguments must be identical.</p>                                                                                                                                                                                                                                                                                |
| Return value:     | Returns the value of the 2nd or 3rd argument depending on the condition.                                                                                                                                                                                                                                                                                                                                                                                                         |
| Description:      | <p>The function allows any conditions to be formulated. The first argument is a logical expression, whose content controls output of the function.</p><p>If the first argument contains the value TRUE, the function returns the value of the second argument. If the first argument is FALSE, the function returns the value of the third argument.</p><p>If the third argument is not specified, the function returns a 0 by default, if the condition is not met (FALSE).</p> |
| Cross-references: | [If function](#func_if)                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

## If function <a href="#func_if" id="func_if"></a>

|               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax:       | ALL If (BOOL, ALL \[, ALL])                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Parameters:   | <ul><li>Condition</li><li>Value in case the condition is TRUE.</li><li>Value in case the condition is FALSE.</li></ul><p>The data types for the second and third arguments must be identical.</p>                                                                                                                                                                                                                                                                                |
| Return value: | Returns the value of the 2nd or 3rd argument depending on the condition.                                                                                                                                                                                                                                                                                                                                                                                                         |
| Description:  | <p>The function allows any conditions to be formulated. The first argument is a logical expression, whose content controls output of the function.</p><p>If the first argument contains the value TRUE, the function returns the value of the second argument. If the first argument is FALSE, the function returns the value of the third argument.</p><p>If the third argument is not specified, the function returns a 0 by default, if the condition is not met (FALSE).</p> |
| See also:     | [Cond function](#func_cond)                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

## IsEven function <a href="#func_iseven" id="func_iseven"></a>

|               |                                                                                                                                                       |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax:       | BOOL IsEven (NUMBER)                                                                                                                                  |
| Parameters:   | <ul><li>The value to be checked.</li></ul>                                                                                                            |
| Return value: | TRUE if the passed value is even, i.e. divisible by 2.                                                                                                |
| Description:  | The function checks whether the passed value is even, i.e. divisible by 2. If the passed value has decimal places, it is rounded up before the check. |
| Example:      | <p>IsEven (3) = FALSE</p><p>IsEven (1200) = TRUE</p>                                                                                                  |
| See also:     | [IsOdd function](#func_isodd)                                                                                                                         |

## IsNoValid function <a href="#func_isnovalid" id="func_isnovalid"></a>

|               |                                                                                                      |
| ------------- | ---------------------------------------------------------------------------------------------------- |
| Syntax:       | BOOL IsNoValid (NUMBER)                                                                              |
| Parameters:   | <ul><li>The value to be checked.</li></ul>                                                           |
| Return value: | In case of an overflow or an invalid value is present TRUE, otherwise FALSE.                         |
| Description:  | Checks whether an overflow occurred during a calculation or whether a variable has an invalid value. |
| See also:     | [NoValid function](/acron-9.3/en/intro/funktionen/funk_variablen.md#func_novalid)                    |

## IsOdd function <a href="#func_isodd" id="func_isodd"></a>

|               |                                                                                                                                                         |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax:       | BOOL IsOdd (NUMBER)                                                                                                                                     |
| Parameters:   | <ul><li>The value to be checked.</li></ul>                                                                                                              |
| Return value: | TRUE if the passed value is odd, i.e. is not divisible by 2.                                                                                            |
| Description:  | The function checks whether the passedvalue is odd, i.e. not divisible by 2. If the passed value has decimal places, it is rounded up before the check. |
| Example:      | <p>IsOdd (3) = TRUE</p><p>IsOdd (1200) = FALSE</p>                                                                                                      |
| See also:     | [IsEven function](#func_iseven)                                                                                                                         |

## MakeDWord function <a href="#func_makedword" id="func_makedword"></a>

|               |                                                                                                                                                                                                                                                                                                        |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Syntax:       | NUMBER MakeDWord (NUMBER, NUMBER)                                                                                                                                                                                                                                                                      |
| Parameters:   | <ul><li>HIGH Word of the resultant 32-bit value.</li><li>LOW Word of the resultant 32-bit value.</li></ul>                                                                                                                                                                                             |
| Return value: | 32-bit combination between the two arguments.                                                                                                                                                                                                                                                          |
| Description:  | <p>The function combines the two 16-bit arguments to a 32-bit number. For this, the content of the first argument is shifted 16 bits to the left and logically ANDed with the second argument.</p><p>A fractional number as an argument is rounded down to the nearest integer before calculation.</p> |
| Example:      | <p>MakeDWord (1, 0) = 65536</p><p>MakeDWord (1,1) = 65537</p>                                                                                                                                                                                                                                          |
| See also:     | [MakeSDWord function](#func_makesdword)                                                                                                                                                                                                                                                                |

## MakeSDWord function <a href="#func_makesdword" id="func_makesdword"></a>

|               |                                                                                                                                                                                                                                                                                                                                                             |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax:       | NUMBER MakeSDWord (NUMBER, NUMBER)                                                                                                                                                                                                                                                                                                                          |
| Parameters:   | <ul><li>HIGH Word of the resultant 32-bit value.</li><li>LOW Word of the resultant 32-bit value.</li></ul>                                                                                                                                                                                                                                                  |
| Return value: | 32-bit combination between the two arguments.                                                                                                                                                                                                                                                                                                               |
| Description:  | <p>The function combines the two 16-bit arguments to a 32-bit number. For this, the content of the first argument is shifted 16 bits to the left and logically ANDed with the second argument. The combination takes account of the preceding sign.</p><p>A fractional number as an argument is rounded down to the nearest integer before calculation.</p> |
| Example:      | <p>MakeSDWord (1, 0) = 65536</p><p>MakeSDWord (1,1) = 65537</p>                                                                                                                                                                                                                                                                                             |
| See also:     | [MakeDWord function](#func_makedword)                                                                                                                                                                                                                                                                                                                       |

## RotateLeft function <a href="#func_rotateleft" id="func_rotateleft"></a>

|               |                                                                                                                                                                                                                                                                                                                   |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax:       | NUMBER RotateLeft (NUMBER, places)                                                                                                                                                                                                                                                                                |
| Parameters:   | <ul><li>Value to be rotated</li><li>Number of places by which it is rotated.</li></ul>                                                                                                                                                                                                                            |
| Return value: | Value after the rotation has been executed.                                                                                                                                                                                                                                                                       |
| Description:  | <p>The function rotates the bits from the first argument to the left by the number of places specified in the second argument. Bits shifted out of the number to the left are re-inserted from the right.</p><p>A fractional number as an argument is rounded down to the nearest integer before calculation.</p> |
| Example:      | <p>RotateLeft (1, 2) = 4</p><p>RotateLeft (0x1000, 20) = 0x00000001</p>                                                                                                                                                                                                                                           |
| See also:     | [RotateRight function](#func_rotateright), [ShiftLeft function](#func_shiftleft)                                                                                                                                                                                                                                  |

## RotateRight function <a href="#func_rotateright" id="func_rotateright"></a>

|               |                                                                                                                                                                                                                                                                                                                                                                |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax:       | NUMBER RotateRight (NUMBER, places)                                                                                                                                                                                                                                                                                                                            |
| Parameters:   | <ul><li>Value to be rotated</li><li>Number of places by which it is rotated.</li></ul>                                                                                                                                                                                                                                                                         |
| Return value: | Value after the rotation has been executed.                                                                                                                                                                                                                                                                                                                    |
| Description:  | <p>The function rotates the bits from the first argument to the right by the number of places specified in the second right by the number of places specified in the second Bits shifted out of the number to the right are re-inserted from the left.</p><p>A fractional number as an argument is rounded down to the nearest integer before calculation.</p> |
| Example:      | <p>RotateRight (1, 2) = 0x40000000</p><p>RotateRight (0x1000, 20) = 0x01000000</p>                                                                                                                                                                                                                                                                             |
| See also:     | [RotateLeft function](#func_rotateleft), [ShiftRight function](#func_shiftright)                                                                                                                                                                                                                                                                               |

## ShiftLeft function <a href="#func_shiftleft" id="func_shiftleft"></a>

|               |                                                                                                                                                                                                                                                             |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax:       | NUMBER ShiftLeft (NUMBER, places)                                                                                                                                                                                                                           |
| Parameters:   | <ul><li>Value to be shifted</li><li>Number of places by which to shift it.</li></ul>                                                                                                                                                                        |
| Return value: | Value after the shift has been executed.                                                                                                                                                                                                                    |
| Description:  | <p>The function shifts the bits from the first argument to the left by the number of places specified in the second. Zeros are fed in at the right.</p><p>A fractional number as an argument is rounded down to the nearest integer before calculation.</p> |
| Example:      | <p>ShiftLeft (1, 2) = 4</p><p>ShiftLeft (0x1000, 20) = 0x00000000</p>                                                                                                                                                                                       |
| See also:     | [ShiftRight function](#func_shiftright), [RotateLeft function](#func_rotateleft)                                                                                                                                                                            |

## ShiftRight function <a href="#func_shiftright" id="func_shiftright"></a>

|               |                                                                                                                                                                                                                                                             |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax:       | NUMBER ShiftRight (NUMBER, places)                                                                                                                                                                                                                          |
| Parameters:   | <ul><li>Value to be shifted</li><li>Number of places by which to shift it.</li></ul>                                                                                                                                                                        |
| Return value: | Value after the shift has been executed.                                                                                                                                                                                                                    |
| Description:  | <p>The function shifts the bits from the first argument to the right by the number of places specified in the second. Zeros are fed in at the left.</p><p>A fractional number as an argument is rounded down to the nearest integer before calculation.</p> |
| Example:      | <p>ShiftRight (1,2) = 0</p><p>ShiftRight (0x1000, 20) = 0x00000000</p>                                                                                                                                                                                      |
| See also:     | [ShiftLeft function](#func_shiftleft), [RotateRight function](#func_rotateright)                                                                                                                                                                            |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.videc.de/acron-9.3/en/intro/funktionen/funk_logik.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
