Red Gate forums :: View topic - IF ... ELSE IF stairstepping...
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Prompt 5
SQL Prompt 5 forum

IF ... ELSE IF stairstepping...

Search in SQL Prompt 5 forum
Post new topic   Reply to topic
Jump to:  
Author Message
chrisw13



Joined: 01 Jul 2013
Posts: 3

PostPosted: Mon Jul 01, 2013 4:15 pm    Post subject: IF ... ELSE IF stairstepping... Reply with quote

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:

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:

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
Back to top
View user's profile Send private message
Manfred.Castro



Joined: 23 Apr 2012
Posts: 209

PostPosted: Tue Jul 02, 2013 5:54 pm    Post subject: Reply with quote

This would be considered a formatting feature request.
You can direct feature requests to our uservoice forums.
http://redgate.uservoice.com/forums/94413-sql-prompt-feature-suggestions
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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group