Post Reply 
ELSE IF END --> ELIF?
07-23-2014, 03:40 AM
Post: #3
RE: ELSE IF END --> ELIF?
Logically they're the same, but if you go back to edit you may get confused, because you have to change the ELIF into an ELSE IF ... and then insert an END in the correct place.
Code:

if condition
  then statement
  else if condition
           then statement
           {else statement}
        endif
endif

It's a construct that seems to creeping in, and I see no good reason for it. In this case, it's easy to see, but if there's over a page or two of nested code, it seems designed to invoke the propagating error corrections gods.

(One of the reason I like labeled things and matching labels for their ends.
Code:

sue:begin
      jerry:if condition
                then statement
                else sam:if condition
                        then statement
                       {else statement}
                     endif(sam)
              endif(jerry)
end(sue)
I rarely get them, though. For a while I used a happy pretty-printer that used a long list of names, prepending and appending them as comments.)
)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
ELSE IF END --> ELIF? - Joe Horn - 07-21-2014, 12:08 PM
RE: ELSE IF END --> ELIF? - Helge Gabert - 07-21-2014, 07:42 PM
RE: ELSE IF END --> ELIF? - htom trites - 07-23-2014 03:40 AM



User(s) browsing this thread: 1 Guest(s)