# Nested IF statements

**URL:** <https://www.ruby-forum.com/t/nested-if-statements/94719>\
**Category:** Ruby\
**Created:** [May 12, 2006, 12:05am UTC](https://www.ruby-forum.com/t/nested-if-statements/94719 "2006-05-12T00:05:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![angelo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/41988e/32.png) [@angelo](https://www.ruby-forum.com/u/angelo)\
**Post date:** [May 12, 2006, 12:05am UTC](https://www.ruby-forum.com/t/nested-if-statements/94719/1 "2006-05-12T00:05:40Z")

</div>

I’m very new to Ruby and am desperately trying to figure out what seems  
to be a fairly simple script. Is there something special I need to know  
in regards to IF statements with Ruby that may differ from most other  
languages?

The structure of the script looks like the following:

for

```
if

    if

    else

    end

elsif

end

if

end

```

end

It’s bugging at the first and only elsif. (syntax error, unexpected  
kELSIF, expecting kEND)

Thanks for any help,  
Angelo
