Integer

See also: Long, Floating number

Resolver – Abstract

Purpose: Returns a statically defined integer that is output as an Integer value.


images/download/attachments/128387029/image2023-1-20_9-46-22-version-1-modificationdate-1676010776645-api-v2.png

IMPORTANT◄ All resolvers for Static values ignore the input value. Within a resolver chain (see Chained resolver) this prevents the processing of all preceding resolvers (if any).

The Integer resolver defines a static 'integer' with the Integer type (value range -2.147.483.648 to 2.147.483.647) in the context of a value configuration.

NOTE◄ The Long resolver covers a larger range of values for static integers.

The Integer resolver is not automatically suggested. If the context of a value configuration explicitly refers to the Integer data type, the Floating number resolver is offered instead, which automatically provides integers either as an Integer or Double depending on the value range.

Configuration

images/download/attachments/128387029/image2023-2-14_14-40-57-version-1-modificationdate-1676382057508-api-v2.png ◄±1|↕► images/download/attachments/128387029/image2023-2-14_14-40-40-version-1-modificationdate-1676382041000-api-v2.png ◄±1|↕► images/download/attachments/128387029/image2023-2-14_14-39-54-version-1-modificationdate-1676381994238-api-v2.png

The value in the input field can be changed either by direct input, pasting from the clipboard, or via the stepper functionality.

  • After each change to the string present in the input field, an immediate attempt is made to validate it as an integer.

    • If the validation fails, the value 0 is assigned immediately.

    • For negative values, the minus sign is only accepted in the first line item.

      • When trying to enter the minus sign in front of the default value 0, it disappears immediately because the validated value is 0 (and not -0).

    • Only digits are effectively accepted in the context of a direct input, except for the following special cases:

      • The minus sign can be inserted subsequently at the first line item if a value other than 0 is present.

        • Example: 123-123

      • Within an existing sequence of digits, one of the characters interpreted as decimal separators (comma or period) can be entered subsequently. This immediately eliminates the subsequent digits which are thereby defined as decimals.

        • Example: 12345123,45123

      • Within an existing sequence of digits, the character 'e' or 'E' can be inserted as an indicator for the exponential notation. Then the digits following so far are interpreted as immediately as a power of ten.

        • Example: 12612e612000000

  • The stepper functionality allows incremental changes of an existing value in steps of ±1.

    • The existing value can be increased/decreased step by step by clicking on the up/down buttons on the right side of the text field.

    • As long as the input field has the focus, the cursor keys (up/down) or, if necessary, the mouse wheel will achieve the same effect.

NOTE◄ If the integer validated after a change exceeds the range of values for the Integer encoded by 32-bits, then the input is replaced by the Integer value encoded by the last 32-bits of the integer entered. The most significant ('first') of the 32-bits encodes the sign (1 = "negative').

Example

Operation

Integer

Binary value

Comment

Example 1

Output value (upper limit of the value range)

2147483647
0111 1111 1111 1111 1111 1111 1111 1111

The binary value appears 'increased by 1' as expected. However, the first of the 32 relevant bits in the Integer value range encodes the negative sign.

The stepper 'overruns' from the maximum value to the minimum value.

└─► Increase by 1 with the stepper

-2147483648
1000 0000 0000 0000 0000 0000 0000 0000

Example 2

Paste the millisecond Long value for the beginning of the year 2022 in the UTC time zone from the clipboard (e.g. as a copy from the XML image of an entity)

1640995200000
1 0111 1110 0001 0010 1110 1111 1001 1100 0000 0000

The 'most significant' bits from the Long value that are not relevant for the Integer value range are ignored.

In the remaining bit sequence, the first three bits for the specific input value are not set. The resulting integer is therefore randomly positive and is well below the upper limit for the Integer value range.

317692928
0001 0010 1110 1111 1001 1100 0000 0000

Example

In order to emphasize the urgency of a warning message stored in localization, it should be displayed to the user in triplicate, similar to emergency messages in radio transmissions.

Configuration:

The configuration shown on the right shows the implementation of an Execute with event action, for triple notification:

  • The Object resolver parameter defines the displayed text via the Value from localization resolver. Since details about this are not of interest, it appears collapsed in the screenshot.

  • In the Execute with event action block, a For each loop is configured whose Resolver for entities uses the Integer resolver to bindingly specify the desired number of iterations (3) as a static integer value in the configuration.

  • A Show alert event action is executed in the action block of the loop.

Runtime example:

images/download/attachments/128387029/image2023-1-20_9-54-52-version-1-modificationdate-1676010776616-api-v2.png

images/download/attachments/128387029/image2023-1-20_9-53-57-version-1-modificationdate-1676010776623-api-v2.png