Automation Engine Script Guide > Ordered by Function > Arithmetics > RANDOM

RANDOM

Script Function: Generates random numbers.

Syntax

RANDOM(Minimum, Maximum, [Basis])

Syntax

Description/Format

Minimum

Minimal value of the generated random number.
Format: Number or script variable

Maximum

Maximal value of the generated random number.
Format: Number or script variableA placeholder for a value within a script.

Basis

Initial value for generation.
Format: Number or script variable


Return code

Random number within the specified range.

Comment

The scriptA particular Automation Engine object type. functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… RANDOM generates random numbers. A number generator creates a number set that is determined by using its initial value - the Basis.

If you do not specify Basis, this script function returns a number that continuously varies between Minimum and Maximum.

If Basis is specified, the random number generator is initialized by this value. The result is a numerical series whose numbers can be read without the Basis being necessary. For a particular initial value, the generated numerical series is always identical: the same numbers are supplied in the same order.

If this script function is processed in a different objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task at the same time, the numerical series that has already been generated is overwritten.

You can only assign positive integers (data type "unsigned") to this script function. The result is also always a positive integer.

Examples

Please note that the generated numerical series when using Basis "1" is an example. Depending on the platform RANDOM is being executed on the series may be different.

 

See also:

Script element Description

ADD

Performs an addition.
SUB Performs a subtraction.
MULT Performs a multiplication.
MOD Returns the remainder of a division.
DIV Returns the remainder of a division.

Script Elements - Arithmetics

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by Function

 


Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support

Copyright © 2016 Automic Software GmbH