Index: openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 5 Jul 2002 05:43:08 -0000 1.10 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 22 Aug 2002 13:26:32 -0000 1.11 @@ -635,11 +635,19 @@ randomInit [ns_time] -proc random {} { +ad_proc random {} { + Return a pseudo-random number between 0 and 1. +} { nsv_set rand seed [expr ([nsv_get rand seed] * [nsv_get rand ia] + [nsv_get rand ic]) % [nsv_get rand im]] return [expr [nsv_get rand seed]/double([nsv_get rand im])] } +ad_proc randomRange {range} { + Return a pseudo-random number between 0 and range. +} { + return [expr int([random] * $range)] +} + ad_proc -public db_html_select_options { { -bind "" } { -select_option "" }