Odd Ruby Error
-
I am using the RDE to make my SU Ruby script. I got a strange issue today: elseif was not a recognized keyword in the RDE but is listed in the ruby documentation. I could not get the code to run until I made nested if/then/else/end blocks. Anyone else seen this?
Chris
-
try elsif
Todd
-
I had this same problem a while ago. This seems to be a weird feature of Ruby where the elsif statement differs from most other programming languages. This is one case where Ruby breaks the "Principle of Least Surprise" that everyone seems to praise it for.

See this article for a tutorial on Ruby conditionals: http://www.math.umd.edu/~dcarrera/ruby/0.3/chp_02/conditionals.html
-
Thanks Todd! I never could have imagined that the spelling was different!!!!
I REALLY feel stupid now.....................
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement