drawint(X;Y)

Returns a random integer between 0 and Y-1, seeded with X.

Syntax

drawint(X;Y)

Input

Argument Type Description
X integer A scalar value

X is the seed

Y integer A scalar value other than 0.

Return Value

A random integer is drawn, with replacement, for each row.

If the current table has only one segment or is a tabulation, then Y may also be negative; in this case |Y| must be greater than or equal to the number of selected rows, and random integers between 0 and |Y|-1 are drawn without replacement.

If X or Y is N/A or if Y is 0, an error is returned.

Note: drawint(X;Y) will not work correctly when selections or links with expansion (expand="1") are used. In such cases, draw_int(X;Y) should be used instead. See draw_int(X;Y) as well as <sel> and <link> for more information.

Example

<base table="default.lonely"/>
<colord hide="c1"/>
<willbe name="int_pos" value="drawint(4892;123)"/>
<willbe name="int_neg" value="drawint(4892;-617)"/>