IF ... ELSE IF stairstepping...

Provides intelligent code completion for SQL Server editors.

Moderators: JonathanWatts, David Atkinson, Anu Deshpande, Paul Stephenson, Michelle Taylor, Mike Upton, justin.caldicott, Aaron Law

IF ... ELSE IF stairstepping...

Postby chrisw13 » Mon Jul 01, 2013 4:15 pm

IF ... ELSE IF statements are indented, which is technically accurate, but not conducive to code flow. It would be nice if the IF was placed on the same line as the ELSE and the following line not indented further...

Example:
Code: Select all
DECLARE @check INT

IF @check = 1
    SELECT  1
ELSE
    IF @check = 2
        SELECT  2
    ELSE
        IF @check = 3
            SELECT  3
        ELSE
            IF @check = 4
                SELECT  4


Better formatting:

Code: Select all
DECLARE @check INT

IF @check = 1
    SELECT  1
ELSE IF @check = 2
    SELECT  2
ELSE IF @check = 3
    SELECT  3
ELSE IF @check = 4
    SELECT 4


Running SqlPrompt 6.0.0.71 EAP
chrisw13
 
Posts: 3
Joined: Mon Jul 01, 2013 3:56 pm

Postby Manfred.Castro » Tue Jul 02, 2013 5:54 pm

This would be considered a formatting feature request.
You can direct feature requests to our uservoice forums.
http://redgate.uservoice.com/forums/944 ... uggestions
These forums are actively monitored by our development team and allow our users to request features and vote on them.
If a feature receives a significant amount of votes or is deemed to have merit development may include the feature in a future release.
Manfred Castro
Product Support
Red Gate Software
Manfred.Castro
 
Posts: 209
Joined: Mon Apr 23, 2012 2:49 pm


Return to SQL Prompt 5

Who is online

Users browsing this forum: No registered users and 0 guests