Seed - Crestron SIMPL+ Reference Manual

Language reference guide
Hide thumbs Also See for SIMPL+:
Table of Contents

Advertisement

Crestron SIMPL+
Language Reference Guide - DOC. 5797G
®

Seed

Name:
Seed
Syntax:
Seed(INTEGER SeedValue);
Description:
Provides a seed or origin for the random number generator so that the numbers
returned by RND and RANDOM are pseudo-random numbers. SEED is not required
for generating random numbers as the random number generator will be seed with a
default value.
This default value is issued at control system restart, not program restart. That is, if
you don't used the SEED call, you will not get the same value if you restart the
program. For any particular value of SEED, the random number generator will
generate a predictable series of numbers. Note that specifying the seed value is global
to all SIMPL+ programs running inside a control system. The sequence begins again
whenever SEED is called.
Parameters:
None.
Return Value:
None.
Example:
INTEGER NUM;
FUNCTION MAIN()
{
SEED(25);
NUM = RANDOM(25, 80);
PRINT("The random number between 25 and 80 is: %d\n", NUM);
}
Version:
SIMPL+ Version 1.00
Software
®
SIMPL+
213

Advertisement

Table of Contents
loading

Table of Contents