Random - Crestron SIMPL+ Reference Manual

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

Advertisement

Crestron SIMPL+
Random Number Functions
Language Reference Guide - DOC. 5797G
®
Random Number Functions Overview
These functions allow a SIMPL+ program to generate a random number.

Random

Name:
Random
Syntax:
INTEGER Random(INTEGER LowerBound, INTEGER UpperBound);
Description:
Generate a random number. Refer to "Seed" on
Parameters:
LowerBound is an INTEGER specifying the lower end of the range.
UpperBound is an INTEGER specifying the upper end of the range.
Both LowerBound and UpperBound are treated as unsigned values.
Return Value:
Returns an unsigned number from LowerBound to UpperBound. Both LowerBound
and UpperBound are legal values.
Example:
INTEGER NUM;
FUNCTION MAIN()
{
NUM = RANDOM(25, 80);
PRINT("The random number between 25 and 80 is: %d\n", NUM);
}
An example output from this would be:
The random number between 25 and 80 is: 42
Version:
SIMPL+ Version 1.00
Software
page 213
and "Rnd" on
page
SIMPL+
212.
®
211

Advertisement

Table of Contents
loading

Table of Contents