SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Did you know? => Topic started by: Dennis on January 26, 2022, 04:27:48 pm

Title: The fastest "else if" in the West
Post by: Dennis 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".