December 12, 2008 at 12:12 pm
Christopher Stobbs (12/11/2008)
Thanks for the alternative Jeff πbut I must say sorry I don't know how the hanging ) stayed as it did.
)
)
Lets see what happens he he he
OK I got it.
If you have a tabs instead of spaces before the ) then it stays as it should and no smiley π
That is great - now, how the heck do you put a tab into this editor?
Jeffrey Williams
βWe are all faced with a series of great opportunities brilliantly disguised as impossible situations.β
β Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
December 12, 2008 at 12:16 pm
Garadin (12/12/2008)
Roger that. Just made the change. Mine was set to 8. It always kinda bugged me that it was so big, but never really bugged me enough to change it. Now set to 4, with save tabs as spaces. Still not sure about this whole terminating semi-colon deal though.
I also have mine set to 8 - and have it replace tabs with spaces. As for the semi-colons, get used to it as it is going to be more and more required. For example, it is now required before the WITH statement when using a CTE.
Jeffrey Williams
βWe are all faced with a series of great opportunities brilliantly disguised as impossible situations.β
β Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
December 12, 2008 at 12:18 pm
December 12, 2008 at 12:19 pm
Jeffrey Williams (12/12/2008)
Garadin (12/12/2008)
Roger that. Just made the change. Mine was set to 8. It always kinda bugged me that it was so big, but never really bugged me enough to change it. Now set to 4, with save tabs as spaces. Still not sure about this whole terminating semi-colon deal though.I also have mine set to 8 - and have it replace tabs with spaces. As for the semi-colons, get used to it as it is going to be more and more required. For example, it is now required before the WITH statement when using a CTE.
I think perhaps I don't understand where they belong. I tried putting one at the end of each line of code in SSMS 2K8 and it caused errors all over the place.
December 12, 2008 at 12:29 pm
The semi-colon is a statement terminator, so you wouldn't put it at the end of every line. Only at the end of each statement - and only before the WITH statement if the previous statement is not terminated with a semi-colon (I put one there always, just in case).
Jeffrey Williams
βWe are all faced with a series of great opportunities brilliantly disguised as impossible situations.β
β Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
December 12, 2008 at 12:31 pm
All this Tab -> spaces debate made me curious... so I did a little test. I'm guessing this is due to it mimic'ing html or something when it converts the tab -> spaces, but that's just a thought being that it makes the wink smiley.
Copied Space (NotePad)
)
Copied Tab (NotePad)
)
Copied Space (Query Analyzer)
)
Copied Tab (Query Analyzer)
)
Space Typed into Edit Box
)
Copied Tab (With Tab -> Spaces Turned on) (Query Analyzer)
)
December 12, 2008 at 2:32 pm
Lynn Pettis (12/12/2008)
Jack Corbett (12/12/2008)
I like tabs and I use 6 and I like to set it to 6 even if I change set it to use spaces. One of those personal things.I like four spaces, personal thing as well, as it helps keep the code from scrolling off the side of the screen. I don't mind scrolling up and down, but really hate it when I have to scroll up and down and left to right to see the code.
Now that's really annoying ... but when you've got the scent it's hard to maintain the discipline innit?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
December 13, 2008 at 10:01 am
Christopher Stobbs (12/12/2008)
Really why do you hate tabs π
Just one reason... formatting. I spend a bit of time making sure that the code is properly indented for high readability. It seems like everyone has their own personal preference for what the tab stops should be set at not to mention the fact that a lot of programs (NotePad, Word, SMS, QA, forums, etc, etc) all have different default tab stops. So, when someone goes to use my code, it looks like crap because the tab stops are different. Spaces are spaces on every system and, with the exception of some forums that remove leading spaces, the formatting of the code is preserved when spaces are used instead of tabs.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 13, 2008 at 11:48 am
Ok... I tried a couple of things out and even the use of non-breaking spaces is no guarantee either in the normal window or a code window...this really stinks especially if you don't want to use tabs...
Contains the indicated number of non-breaking spaces
) --1
) --2
) --3
) --4
) --5
) --6
) --7
) --8
) --9
) --10
Contains the indicated number of spaces followed by a non-breaking space
) --1
) --2
) --3
) --4
) --5
) --6
) --7
) --8
) --9
) --10
Contains the indicated number of tabs
)--1
)--2
)--3
)--4
)--5
)--6
)--7
)--8
)--9
)--10
Contains the indicated number of non-breaking spaces
) --1
) --2
) --3
) --4
) --5
) --6
) --7
) --8
) --9
) --10
Contains the indicated number of spaces followed by a non-breaking space
) --1
) --2
) --3
) --4
) --5
) --6
) --7
) --8
) --9
) --10
Contains the indicated number of tabs
)--1
)--2
)--3
)--4
)--5
)--6
)--7
)--8
)--9
)--10
This uses the & # 160 ; code... same as what the Simple-Talk prettifier uses... by itself, it doesn't work either...
) --1
) --2
) --3
) --4
) --5
) --6
) --7
) --8
) --9
) --10
Neither does it work in a code window...
) --1
) --2
) --3
) --4
) --5
) --6
) --7
) --8
) --9
) --10
... but, if you use the Simple-Talk prettifier and don't make ANY changes, it comes out looking pretty decent...
[font="Courier New"] ) --1
) --2
) --3
) --4
) --5
) --6
) --7
) --8
) --9
) --10
[/font]
I checked the code the prettifier uses... I just didn't see anything obvious in it that makes it work the way it does... I even tried to manually add the font and size codes and still got the smiley faces.
But, then... I got it... two different ways...
Here, I replaced all parenthesis with the & # 041 ; code (again, remove the spaces)
) --1
) --2
) --3
) --4
) --5
) --6
) --7
) --8
) --9
) --10
... and here, I replaced the parenthesis with [ b ][ / b ]) (remove the spaces, again)
) --1
) --2
) --3
) --4
) --5
) --6
) --7
) --8
) --9
) --10
It's still a pain in the haunches, and both still slam stuff to the left if there's only one leading space, but they both work nicely without having all the codes the prettifier puts in which can make things a bit difficult to edit if you need to.
Now, if we can just get Steve to automatically change all right parenthesis to the 041 code in code windows only, and we'll be all set. Oh yeah, in case you miss them, here's a smiley face for ya... π
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 9 posts - 31 through 38 (of 38 total)
You must be logged in to reply to this topic. Login to reply