Menu

Else If statements

2004-10-21
2013-05-23
  • Charl van Jaarsveldt

    Hallo,

    I noticed that in statements like:
    If foo Then
    Begin
    End Else If bar Then
    Begin
    End;
    The else if bit is replaced by:
    Else Begin
      If bar Then
      Begin
      End;
    End;

    (in other words else if is replaced with else begin if)
    Is there a setting to disable this? I can't find anything.

    Thanx
    C

     
    • Charl van Jaarsveldt

      I found the option to take care of it. There is an option to put single statements in a begin..end block. Since Else if is a single statment for the else, it gets a begin end.

      Now, it would be nice to be able to enforce the begin end around a single statement, but keep the else if as a pascal thing. (So keep the option to enforce a begin end around single statements, but it shouldn't apply to else if)

      Thank you.

       
    • Anthony Steele

      Anthony Steele - 2004-11-04

      Hm, that's not quite right. The "single statement in begin end" option (still a fairly new feature) should leave "else if" alone. I will add it to the bugs list.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.