Home Search

DriveWorks Solo 22
VariableGetUniqueNumber

Send Feedback

VariableGetUniqueNumber

Gets a unique number for a variable which belongs to a sequence of variables.

Syntax

VariableGetUniqueNumber([Variable Prefix],[Variable Suffix], [Variable Index])

Where:

Variable Prefix is the name of the variable that appears before its number.

Variable Suffix is the name of the variable that appears after its number.

Variable Index is the number of the variable for which to calculate the unique number.

The sequence of numbers used in the variable names must run consecutively, without any numbers being skipped.

Variable Prefix and Suffix values are not case sensitive.

Variables that result in text strings are also not case sensitive.

This function will search in all categories and sub-categories for variables that match the specified prefix and suffix values.

Examples - Using Variable Prefix

Refer to Variable Names table below

RuleResultWhy?
VariableGetUniqueNumber("Var","",1)1Because "Hello" is the first unique value in the sequence of variables running from Var1 to Var 1
VariableGetUniqueNumber("Var","",2)2Because "World" is the second unique value in the sequence of variables running from Var1 to Var 2
VariableGetUniqueNumber("Var","",3)1Because "Hello" was already assigned the number 1 in the sequence of variables running from Var1 to Var 3
VariableGetUniqueNumber("Var","",4)3Because "John" is the third unique value in the sequence of variables running from Var1 to Var 4

Example Variables

Variable Name

Value
Var1"Hello"
Var2"World"
Var3"Hello"
Var4"John"

Examples - Using Variable Prefix and Suffix

Refer to Variable Names table below

RuleResultWhy?
VariableGetUniqueNumber("Item","Qty",1)1Because 8 is the first unique value in the sequence of variables running from Var1 to Var 1
VariableGetUniqueNumber("Item","Qty",3)3Because 18 is the third unique value in the sequence of variables running from Var1 to Var 3
VariableGetUniqueNumber("Item","Qty",4) 2Because 12 was already assigned the number 2 in the sequence of variables running from Var1 to Var 4
VariableGetUniqueNumber("Item","Qty",5) 4Because 27 is the fourth unique value in the sequence of variables running from Var1 to Var 5

Example Variables

Variable Name

Value
Item1Qty8
Item2Qty12
Item3Qty18
Item4Qty12
Item5Qty27