Let's not forget the each_index method, then the size of the array no longer matters:

pubInfoTextFields.each_index {|x|
  Simple1.fill_text_field(pubInfoTextFields[x], pubInfo[x])
  puts "pubInfoTextFields = "+pubInfoTextFields[x]+"   pubInfo = "+pubInfo[x]
}

On 7/19/06, Paul Carvalho <[EMAIL PROTECTED]> wrote:
Ruby rocks!  My fav is:

  9.times {|x| puts x}

It doesn't get any clearer for me than just telling it how many times I want it to loop without worrying about extra syntax that I'm likely to get wrong.. ;)




On 19/07/06, Chris McMahon < [EMAIL PROTECTED]> wrote:
On 7/19/06, mi <[EMAIL PROTECTED]> wrote:
> ahhhhhhhhhhh, That was it!!!  I'm just NOT used to start an iteration
> form 0:-(  THANKS a million!!!!!!!!

Ruby folks don't generally use for loops:


1.upto 9 do |x|
  puts x
  end

ruby loop.rb
1
2
3
4
5
6
7
8
9
>Exit code: 0


_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general




--
"I am the most humble person in the world!"
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to