Welcome to MSDN Blogs Sign in | Join | Help

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.

Published Sunday, August 07, 2005 11:54 PM by Calvin_Hsia
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Remove double spaces from pasted code samples in blog

Thursday, August 11, 2005 3:14 PM by Lou Harris
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.

# re: Remove double spaces from pasted code samples in blog

Thursday, August 11, 2005 5:07 PM by Dawa Tsering
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.

# Cool Linq Query

Sunday, August 12, 2007 1:45 AM by Calvin Hsia's WebLog

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

# MSDN Blog Postings » Cool Linq Query

Sunday, August 12, 2007 2:49 AM by MSDN Blog Postings » Cool Linq Query

# Create your own web browser on your SmartPhone

Monday, October 01, 2007 4:42 PM by Calvin Hsia's WebLog

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

# MSDN Blog Postings » Create your own web browser on your SmartPhone

# Famous Birthdays » Blog Archive » Calvin Hsia’s WebLog : Computer music on the radio

# Create your own Test Host using XAML to run your unit tests

Thursday, March 27, 2008 12:27 PM by Calvin Hsia's WebLog

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

# Write simple Debug helpers to help you debug and maintain your code

Wednesday, December 03, 2008 6:07 PM by Calvin Hsia's WebLog

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

# Which pixels do you turn on when you draw a line?

Monday, March 30, 2009 2:50 PM by Calvin Hsia's WebLog

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

# Area fill algorithm: crayons and coloring book

Thursday, April 30, 2009 1:43 PM by Calvin Hsia's WebLog

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

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker