draw_int(X;Y)

Returns a random integer using a given seed that remains persistent (sticky) even after selections or links with expansion are used.

Syntax

draw_int(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: draw_int(X;Y) will work correctly even when selections or links with expansion (expand="1") are used because the results are sticky. This means that the random integer generated by the function for each row will be the same after the expansion. When the drawint(X;Y) function is used, a different integer will be generated for each of the expanded rows.