Re: [wtr-general] Random value from a select list

2010-09-30 Thread Felipe Knorr Kuhn
Another option: array[rand(array.size)] On Thu, Sep 30, 2010 at 10:25 AM, Željko Filipin < zeljko.fili...@wa-research.ch> wrote: > On Thu, Sep 30, 2010 at 3:15 PM, ISmellGas > wrote: > > Is it possible to get the contents of the select list into an array, > > count how many items are in that ar

Re: [wtr-general] Random value from a select list

2010-09-30 Thread Željko Filipin
On Thu, Sep 30, 2010 at 3:15 PM, ISmellGas wrote: > Is it possible to get the contents of the select list into an array, > count how many items are in that array and select a random one? Sure, select_list.options will return array of contents, then just pick a random one: Select lists: http://wi

[wtr-general] Random value from a select list

2010-09-30 Thread ISmellGas
Hi, I am trying to populate a select list with a random value from the list but I am not sure how I can achieve this. Is it possible to get the contents of the select list into an array, count how many items are in that array and select a random one? Sorry if this is a slightly incoherent questi