Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Random - method of object Pm

Description:
Returns a random number in defined range.
Syntax:
Random(nLow As Double, nHigh As Double) As Double
Calling:
n = Pm.Random(nLow, nHigh)
Parameters:
nLow(Double) bottom range limit
nHigh(Double) upper range limit
Note:
The method can also be called in the graphic item events for Web Panels.

The method is functional also in Macro expression $.expr.

Example1:
Computation of a random number ranging from 0 to 100 rounded to a integer
nVar = Pm.Round(Pm.Random(0, 100), 1)
Example2:
Emulation of "Temperature" value in defined range.
Dim oVar, nMin, nMax
Set oVar = pMe.Pm("/Data/#vars/Temperature")
nMin = 20
nMax = 100
oVar.Value = oVar.Value + 0.1 * Pm.Random(nMin - oVar.Value, nMax - oVar.Value)
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- LN2
- PI
- Pow
- Random
 
 
- Sin
- Tan
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice