Using the following code in Ruby:
if (tickFormat.length > 12 && tickFormat.length < 24)
i = 1
while(i < tickFormat.length) do
if (i%2 != 0)
tickFormat.at(i)[1] = ''
end
i++
end
end
I get an "unexpected keyword_end" for the 2nd "end" statement. If I remove the while loop the code runs without error. Any ideas?
Try this:
if (tickFormat.length > 12 && tickFormat.length < 24)
i = 1
while(i < tickFormat.length) do
if (i%2 != 0)
tickFormat.at(i)[1] = ''
end
i += 1
end
end
The i++ syntax doesn't work in Ruby
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With