December 27, 2007 at 9:02 am
I see that there is a forum etiquete article that gives some great examples of how to post code.
However, my question is in the opposite direction. It would seem that once I copy and paste code from the forum into an editor such as QA or Slick Edit or notepad etc... all the formatting including CR/LF pairs is removed.
I assume that it is I who is doing something wrong what's the trick?
December 27, 2007 at 9:42 am
December 27, 2007 at 10:46 am
Until they fix it, there's a work around...
1. Put your cursor one line above the code box.
2. Click and drag to one line below the code box.
3. Copy
4. Open MS Word
5. Paste
6. Do a Search'n'Replace... replace ^l (Circumflex followed by lower case "L") with ^p (Circumflex followed by lower case "P).
7. Select all and copy.
8. Paste into Query Analyzer. All formatting is preserved.
And thanks for the compliment on the article.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 27, 2007 at 11:47 am
Thanks! That seems to work. What are these RTF codes for hard and soft return?
December 27, 2007 at 12:18 pm
Hard returns are CHAR(13)... Soft returns are actually vertical tabs (CHAR(11))... if that's what you meant...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 27, 2007 at 1:24 pm
That's what I mean, however, that is not what we are looking at are we? I guess ms word and the rich text edit control or whatever control being used is not ascii.
^i = ascii(9) - tab
^j = ascii(10) - linefeed
^k = ascii(11) -vert tab
^l = ascii(12) -form feed (new page) ???soft return
^m = ascii(13)-carriage return
^p = ascii(16) -data link escape ???hard return
None of this really matters, as long as it works! 🙂
Just observations.
December 27, 2007 at 1:31 pm
Heh... no, not what we're looking at in Word... Yes, I understand the control character notation for things like ^m (ASCII 13 or Hex OD)... Word seems to have it's own bit of notation... the "L" in ^l is supposed to be for soft Line and the "P" in ^p is supposed to be for Paragraph... supposed memory aids for the ASCII uninitiated.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 27, 2007 at 1:36 pm
How many M$ employees does it take to change a lightbulb....
None, they just declare darkness to be the standard.
🙂
Silly me, assuming again...
December 27, 2007 at 4:11 pm
Microsoft still uses lightbulbs? 😛 I heard they couldn't find anyone who still knew how, so they've shifted to HI-LEDs that never need changing.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 28, 2007 at 1:44 am
Jeff Moden (12/27/2007)
Until they fix it, there's a work around...1. Put your cursor one line above the code box.
2. Click and drag to one line below the code box.
3. Copy
4. Open MS Word
5. Paste
6. Do a Search'n'Replace... replace ^l (Circumflex followed by lower case "L") with ^p (Circumflex followed by lower case "P).
7. Select all and copy.
8. Paste into Query Analyzer. All formatting is preserved.
And thanks for the compliment on the article.
And if the code is posted in a forum, click reply with quote ;copy the code and paste it in QA
Failing to plan is Planning to fail
December 28, 2007 at 7:50 am
Jeff Moden (12/27/2007)
Microsoft still uses lightbulbs? 😛 I heard they couldn't find anyone who still knew how, so they've shifted to HI-LEDs that never need changing.
I heard that they are all so bright there that they don't need external light sources. :w00t: (Boo! Hiss! Yeah, I know.)
December 28, 2007 at 11:30 am
Heh... yeah... so they would say! After seeing the cruddy stored procedures they wrote (like sp_SpacedUsed, for example), it must be a "black light" 😛
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply