Author Topic: The fastest "else if" in the West  (Read 1492 times)

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3618
  • Hero Points: 481
The fastest "else if" in the West
« on: January 26, 2022, 04:27:48 pm »
Did you know you can add an else-if clause in brace-oriented languages with one keypress?

Try this:
Code: [Select]
            if ( condition_one ) {
                // type a close brace on the next (blank) line
                |
            } else {
            }

You will be left with this:
Code: [Select]
            if ( condition_one ) {
                // type a close brace on the next (blank) line
            } else if ( | ) {
            } else {
            }

Did you really want just a close brace?  Easy, hit Undo:
Code: [Select]
            if ( condition_one ) {
                // type a close brace on the next (blank) line
            }
            } else {
            }

Note:  If you do not already have the "else" clause, you will be prompted whether you want to add an "else if" or an "else".