Command Reference

Generate Random Value

Assigns a random value to a variable.

Action ID: 38
Action Category: Variables

Settings

Variable

Store result in variable

The name of the variable that will hold the random value.

Generation Mode

The method to use to generate the value:

Number between values

Generate a number between Minimum and Maximum, inclusive.

String based on mask

The value will be based on a mask. The following special mask characters may be used:

Character

What will be generated

#

Random number ("0-9")

*

Uppercase letter ("A-Z")

@

Lowercase letter ("a-z")

?

Random number or uppercase letter ("A-Z", "0-9")

-

A dash character ("-")

A literal character

The literal character will be displayed

Return Values

None.

Examples

Example 1

In this example we will generate a random value from 1 to 10. We will store this value in a custom variable named %RanNum%.

Store result in variable: %RanNum%
Number between values Minimum: 1
Number between values Maximum: 10
String based on Mask: NA

Example 2

In this example we will generate a random serial number of the form: 'SetupFactory-12345' and store it in a custom variable named %RandomSerial%.

Store result in variable: %RandomSerial%
Number between values: NA
String based on Mask: SetupFactory-#####

 

See Also: Alphabetical List of Actions, Categorical List of Actions, On Error tab