RANDOM_SAMPLE$
|
Syntax: |
RANDOM_SAMPLE$(<Range>,<Numbers>,<Put
back>,<Sort>)
|
||||||||
|
|
|
||||||||
|
Meaning: |
Creates
a random sample of a range of numbers. <Range>
specifies the quantity of numbers from 1 to <Range>. <Numbers>
specifies the amount of numbers to draw. If
<Put back> <> 0, drawed numbers are put back. Numbers can be
drawn multiple. If
<Put back> = 0, drawed numbers are not put back. Numbers can be
drawn only once. If
<Sort> > 0, the sample space is sorted ascending. If
<Sort> < 0, the sample space is sorted descending. RANDOM_SAMPLE$
returns the drawn numbers separated by ";". RANDOM_SAMPLE$
returns the following error codes: "-1":
<Numbers> < 1 "-2":
<Numbers> > <Range> and <Put back> = 0. |
||||||||
|
Parameter: |
|
||||||||
|
Sample: |
LOTTERY_NUMBERS$ = RANDOM_SAMPLE$(49,6,0,1) IF VAL(LOTTERY_NUMBERS$) < 0 THEN ... Error
... ELSE /* LOTTERY_NUMBERS$
contains e.g. 4;8;23;36;48;49 ENDIF |
||||||||
|
See also: |
|