SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Code Formatting


Code Formatting

Author
Message
Steve Jones
Steve Jones
SSC Guru
SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)

Group: Administrators
Points: 145727 Visits: 19425
New code formatting has been released on SSC. Please feel free to check it out and comment.

Use the [ code ][ /code ] shortcuts to the right for enclosing code items.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
GSquared
GSquared
SSC Guru
SSC Guru (57K reputation)SSC Guru (57K reputation)SSC Guru (57K reputation)SSC Guru (57K reputation)SSC Guru (57K reputation)SSC Guru (57K reputation)SSC Guru (57K reputation)SSC Guru (57K reputation)

Group: General Forum Members
Points: 57407 Visits: 9730
It seems to be dropping blank lines in the format. Maybe I'm doing something wrong, but it seems to be doing so.

Line one, followed by a blank line

Line two



That has a blank line between the two, in the edit screen. Makes it a bit harder to view longer code pieces.

I like the line-wrap though! Very cool! No more left-right scroll because someone had a piece of code 10000-characters wide!

- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread

"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Ramesh Saive
Ramesh Saive
SSCertifiable
SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)

Group: General Forum Members
Points: 6702 Visits: 2643
I really loved the colored output:-D, it makes real easy to read the code. But there seems to be some problem with the text "ADD" as it adds itself twice to the output (i.e. "ADDADD" is being shown, 1 with blue color and other with pink color).


ALTER TABLE [dbo].[type_of_fraud]
ADD [matchfile_autoload] char(01) NOT NULL
CONSTRAINT DF_No_matchfile_autoload DEFAULT('N')



Edit:
And also, it would be better if you can make the font size same as the normal text.

--Ramesh


bitbucket-25253
bitbucket-25253
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15659 Visits: 25280
Steve
A great improvement ..... for posting as well as reading what code others have posted.

If everything seems to be going well, you have obviously overlooked something.

Ron

Please help us, help you -before posting a question please read

Before posting a performance problem please read
Jack Corbett
  Jack Corbett
SSC-Forever
SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)

Group: General Forum Members
Points: 44371 Visits: 14925
Definitely an improvement. I haven't seen the issues mentioned yet though. This has been a light day for me posting code. I've mainly added links.



Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming
At best you can say that one job may be more secure than another, but total job security is an illusion. -- Rod at work

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
StarNamer
StarNamer
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2768 Visits: 1992
While I like the color highlighting and wordwrap, there's something distinctly odd with it.

I use IE6 (Company Policy) and the code backgroup tends to come out as random gray/white horizontal stripes, occasionally solid gray (which is what I suspect it should be.

Also when I looked at my recent posts page, I get some very odd behaviour. It looks like the code blocks are overlaid all over the messages. See attached partial screenshot.

Derek
Attachments
ssc screenshot.bmp (17 views, 734.00 KB)
GSquared
GSquared
SSC Guru
SSC Guru (57K reputation)SSC Guru (57K reputation)SSC Guru (57K reputation)SSC Guru (57K reputation)SSC Guru (57K reputation)SSC Guru (57K reputation)SSC Guru (57K reputation)SSC Guru (57K reputation)

Group: General Forum Members
Points: 57407 Visits: 9730
Another (minor) thing is that it seems to ignore "nvarchar". "Varchar" ends up blue, but "nvarchar" ends up black.

- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread

"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
GilaMonster
GilaMonster
SSC Guru
SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)

Group: General Forum Members
Points: 223093 Visits: 46294
Steve Jones - Editor (3/17/2009)
New code formatting has been released on SSC.


Ooooohhhh..... Nice!

Jack Corbett (3/17/2009)
This has been a light day for me posting code. I've mainly added links.


I don't think I've posted any code this week yet.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Lowell
Lowell
SSC Guru
SSC Guru (71K reputation)SSC Guru (71K reputation)SSC Guru (71K reputation)SSC Guru (71K reputation)SSC Guru (71K reputation)SSC Guru (71K reputation)SSC Guru (71K reputation)SSC Guru (71K reputation)

Group: General Forum Members
Points: 71288 Visits: 40930
seems to hate less-than and greater-than symbols:
this line has the ampersand-LT-semicolon:
salesMonth <=@month and YTD = 0 OR salesMonth = @month and YTD <> 0
this is as you'd type it
 salesMonth   0



strips the middle portion of the code out assuming an HTML tag.

Lowell
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Steve Jones
Steve Jones
SSC Guru
SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)

Group: Administrators
Points: 145727 Visits: 19425
Thanks for the notes. I'm logging some bugs.

- The ADDADD thing, we had that with some other keywords and cleaned them up. We missed this one.
- Blank lines, noted
- background - We have code tags, it's possible some are missing. If that's the case, you'd get the solid gray. Other code items are made with the alternating greenbar type formatting of white and light gray. We can make it solid.
- Font size, noted. Not sure if I want it the same or smaller to stand out.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search