|
Generating Random Numbers
|
|
| RandNum(Seed)
|
| This returns a random decimal value greater than or equal to 0 and less than 1. The random values are distributed rectangularly, meaning that there is an equal probability of receiving a value between 0 and 0.1, 0.1 and 0.2, 0.3 and 0.4, etc. The Seed must be an integer zero or greater, and is used to seed the random number generator. The seed value used is actually the internal respondent number plus the specified seed. Therefore, if you call the RandNum function again for this respondent with the same given seed you will receive the same random value. But, different random values are generated for different respondents.
|
|
|
| RandNum(Seed, Min#, Max#)
|
| This returns a random integer in the range of Min# to Max#. Using a specific seed integer is useful if you want to be able to generate the same random value later in the questionnaire. The Seed must be an integer zero or greater, and is used to seed the random number generator. The seed value used is actually the internal respondent number plus the specified seed. Therefore, if you call the RandNum function again for this respondent with the same given seed you will receive the same random value. But, different random values are generated for different respondents.
|
| SysRand( )
|
| This returns a random decimal value greater than or equal to 0 and less than 1. The random values are distributed rectangularly, meaning that there is an equal probability of receiving a value between 0 and 0.1, 0.1 and 0.2, 0.3 and 0.4, etc. The seed value used is the system clock at the moment the instruction is encountered.
|
|
|
| SysRand(Min#, Max#)
|
| This returns a random integer in the range of Min# to Max#. The seed value used is the system clock at the moment the instruction is encountered.
|