Description

Generates an array of random numbers with values between 0 and 32768

Return Type

A McObject object.  

A McObject holding a single random number if lNofResults is not given or is 1. Otherwise returns an McObject holding a 1-D array of Long values containing random numbers, with the length determined by the value of Arg0. HRESULT

Syntax

object.McRand ([lNofResults], [lSeed])

The McRand Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McOMGlobal.
lNofResultsOptional. A Long value.

Number of random values to return (1 by default).

lSeedOptional. A Long value.

A seed value. A value of 1 reinitializes the sequence.

Remarks

To generate the same sequence of random numbers repeatedly, re-seed the sequence generator with McRand(, 1). Random values are uniformly distributed in the range from 0 to 32768 (&H7FFF&, which is the largest value that a VB Integer can hold).