Hi Polleu,

Not sure if I got your query right, I guess u r trying to execute the loop thru irb. If thats the case use following statement to start IRB:

irb --noreadline

I found that your loop is properly defined. To test I have assigned some value to i. Here is the code:

i=9
if (i == 4) then
puts "4"
elsif (i == 9) then
puts "9"
else
puts "other"
end
U might also rethink to use case instead of if...

Hope this helps,

Vishal
--- [EMAIL PROTECTED] wrote:

From: [EMAIL PROTECTED]
Date: Fri, 25 Nov 2005 13:04:00 +0100 (CET)
To: [email protected]
Subject: [Wtr-general] if else syntax question

Hi all,

Im trying to run

if (i == 4) then
$branch_column2[count] = table[i][2].text_field(:index,
1).name.to_s
count += 1
$branch_column2[count] = table[i][2].text_field(:index,
1).name.to_s
elsif (i == 9) then
$branch_column2[count] = table[i][2].select_list(:index,
1).name.to_s
else
$branch_column2[count] = table[i][2].text_field(:index,
1).name.to_s
end

but I always get an error message, regardless on how I organise the if -
else loop.

Would anyone know?



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


 

Join SQAtester.com Community ---> http://www.sqatester.com/testersarea/joinus.htm
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to