I have a set of variables, with similar names, except for the last character.  
So for instance, lets say that I have three variables var1, var2, and var3.  My 
problem is that I am trying to refer to these variables using a loop, and I am 
not quite sure how to make it work.  Here is an example of my code.


x = 1


while(x < =3)

  puts var[x]

  x += 1



In this example, I am trying to print var1, var2, and var3 to the screen with 
the while loop.  So what I am asking is how do I make the 'x' be recognized as 
a variable.  In other instances, I have used #{}, but that does not seem to 
work in this case.  I can elaborate if this is not clear.  Thanks in advance 
for all help.


- Shelton

See how Windows Mobile brings your life together—at home, work, or on the go.
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to
Before posting, please read the following guidelines:
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to