From: stefan heinrich Date: 2013-07-10T03:55:55+09:00 Subject: Re: create variables depending on counter Yes as you mentioned it should look like ['Dog', 'Dog'] and ['Car, Car, Car]. If it doesn't make sense for you i have to explain more. I have a gui with a tablewidget. Dog and Car are only row Headlines. Values Dog | 12 Car | 14 Car | 67 Dog | 98 Dog | 32 I search for the Headlines and get the value from the current row. My programme has to be intelligent and he should knows how many different headlines I have. Depending on how many Variables I have my programme should create new Array with only the values with the same headline. Like this: Arraydog = 12, 98, 32 Arraycar = 14, 67 Now I can combinate each value from the array with the values from the other Arrays. The main thing is one value shouldn't combine with a value in the same class. I have this code: a= arraydog, arraycar combine = a.first.product(*a[1..-1]).map(&:join) It works fine but only if I have two different Headlines. With more or less headlines it doesn't works... -- Posted via http://www.ruby-forum.com/.