Crestron simpl plus language ref 사용자 설명서

다운로드
페이지 374
Crestron SIMPL+
®
Software 
Language Reference Guide - DOC. 5797G
 SIMPL+
®
 
z 211
Random Number Functions
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 
 and “Rnd” 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