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 (12)

  1. Lou Harris says:

    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.

  2. Dawa Tsering says:

    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.

  3. Now that Visual Studio 2008 Beta 2 is out the door, I can write about some cool Linq Queries, and you

  4. Windows Mobile 5.0 comes with a Web Browser (v6 is due out any day now). It runs on Pocket PCs and SmartPhones.

  5. A few days ago, somebody came into my office and plopped down a box. It seemed very light. He said that

  6. Much of my time is spent using the Visual Studio debugger examining code to figure out how it works and

  7. When I wrote my cartoon animation program almost 30 years ago (see Cartoon animation program ) I needed

  8. Kids know how to use crayons and a coloring book. How do you write such a program? In my last post (

Skip to main content