SlickEdit Product Discussion > Did you know?

The fastest "else if" in the West

(1/1)

Dennis:
Did you know you can add an else-if clause in brace-oriented languages with one keypress?

Try this:

--- Code: ---            if ( condition_one ) {
                // type a close brace on the next (blank) line
                |
            } else {
            }

--- End code ---

You will be left with this:

--- Code: ---            if ( condition_one ) {
                // type a close brace on the next (blank) line
            } else if ( | ) {
            } else {
            }

--- End code ---

Did you really want just a close brace?  Easy, hit Undo:

--- Code: ---            if ( condition_one ) {
                // type a close brace on the next (blank) line
            }
            } else {
            }

--- End code ---

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".

Navigation

[0] Message Index

Go to full version