Hi, just realised something about my second example. I think the confusion is the 'else if' statement, which I should have written as elseif without the space. This makes all the difference! I'm currently developing a Windows app using an older basic-language called PowerBasic, and there is an elseif statement (without the space) and with this the code example I gave does not require the extra endif, but with the space then you are correct, the extra endif is needed. So just a good example of how careful we must be switching between different programming tools.