共用方式為


Remove double spaces from pasted code samples in blog

If you highlight a recent code sample from my blog and paste it into VFP, you might see the code double spaced. This can be annoying, especially if there are line continuation characters:

            x= "This is a " +;

            "continued line"

I’ve found that to avoid this, I can paste into a new Outlook message (which I have configured to use MSWord as my email editor), then click on (or alt-shift-F10) the little smart tag icon to alter the paste format to “Match Destination Formatting”, then copy/paste into VFP, the extra lines are removed.

The host blogging software changed a few months ago, so the HTML for older posts may behave differently with regard to double-spacing.

Comments

  • Anonymous
    August 11, 2005
    NOTEPAD works as well, paste into a blank NOTEPAD window. (be sure that WORDWRAP is turned off!) Then select the text and copy/cut it back to the clipboard. Then paste it into VFP and it does not have the extra blank lines.

  • Anonymous
    August 11, 2005
    After you copied the code, then type the following in the command window and run it:

    _cliptext = STRTRAN(_cliptext,CHR(13)+CHR(13),CHR(13))

    Then paste it to editor to see the result.

  • Anonymous
    August 11, 2007
    Now that Visual Studio 2008 Beta 2 is out the door, I can write about some cool Linq Queries, and you

  • Anonymous
    August 11, 2007
    PingBack from http://msdnrss.thecoderblogs.com/2007/08/12/cool-linq-query/

  • Anonymous
    October 01, 2007
    Windows Mobile 5.0 comes with a Web Browser (v6 is due out any day now). It runs on Pocket PCs and SmartPhones.

  • Anonymous
    October 01, 2007
    PingBack from http://msdnrss.thecoderblogs.com/2007/10/01/create-your-own-web-browser-on-your-smartphone/

  • Anonymous
    January 05, 2008
    PingBack from http://birthdays.247blogging.info/?p=3268

  • Anonymous
    March 19, 2008
    PingBack from http://frankthefrank.info/entry.php?id=kwws%3d22eorjv1jrwgrwqhw1frp2fdoylqbkvld2dufklyh2533823%3b23%3a277%3b%3b%3b%3c1dvs%7b

  • Anonymous
    March 27, 2008
    The comment has been removed

  • Anonymous
    December 03, 2008
    Much of my time is spent using the Visual Studio debugger examining code to figure out how it works and

  • Anonymous
    March 30, 2009
    When I wrote my cartoon animation program almost 30 years ago (see Cartoon animation program ) I needed

  • Anonymous
    April 30, 2009
    Kids know how to use crayons and a coloring book. How do you write such a program? In my last post (