autonumber(a,b,c,d)

When the function is called for the first time (in the first profile run), the number range a is created for this profile (if d is not true ). The internal counter of the number range is set to b. See section "Profile values" (you can also adjust the internal counter there). The return value of the function is the current value of the internal counter. The number range (and its value) is retained for the next function call or profile run.

With each further call of the function, the internal counter is increased by 1 (if d is not true). If the value of the internal counter exceeds the maximum c or if the value of the internal counter falls below the minimum b, the internal counter is reset to the minimum b. The return value of the function is the current value of the internal counter.

If parameter d is set to true, the internal counter is not incremented. In addition, the return value of the function is always the value b+1 (i.e. independent of the value of the internal counter).

Important note: Please note that the parameters b and c can have different values each time the function is called. The minimum and maximum of the number range are therefore not saved, but set dynamically. The logic for determining the current value of the internal counter remains as described above.

Important note: When this function is executed, a connection to the main database ("hub") is established and closed again. Please note that this can lead to large performance losses with very frequent function calls.

Parameters


Parameter

Description

a

Name of the number range. Important note: Case-sensitive!

b

Minimum of the number range.

c

Maximum of the number range.

d

(optional) If true, the number range is not incremented. In addition, the return value of the function is always the value b+1 (i.e. independent of the value of the internal counter) . Default: false. Note: The use makes sense, for example, if you do not want the number range to be incremented in mapping tests. It is recommended to use the system variable VAR_IS_TEST as parameter in this case.

Examples


The calls are made in this order. The first call is the first call for this profile and number range.


Parameter a

Parameter b

Parameter c

Parameter d

Result

Internal counter

number_range_1

10

13


10

10

number_range_1

10

13


11

11

number_range_1

10

13


12

12

number_range_1

10

13

true

11

12

number_range_1

10

13


13

13

number_range_1

10

13


10

10

number_range_1

17

30


17

17