xowiki::randomized_index (public)
xowiki::randomized_index [ -seed seed ] length
Defined in packages/xowiki/tcl/xowiki-utility-procs.tcl
Return a single randomized value between 0 and length-1.
- Switches:
- -seed (optional)
- Parameters:
- length (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- api_randomized
Source code: # In case, the seed is specified, set the seed to this value to # achieve e.g. a stable bat random order for a user. # if {[info exists seed]} { expr {srand($seed)} } return [expr {int(($length-1) * rand())}]XQL Not present: Generic, PostgreSQL, Oracle