Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy and Paste 'Code'

Status
Not open for further replies.

NasibKalsi

Programmer
Jan 8, 2004
417
CA
When I copy/paste the example "Code" from this forum, I have to manually add the Cr/Lf. The paste is a one continous line without any Cr/Lf. For example:

Public oForm
oForm = CreateObject("MyForm")

After pasting, the result will look like

Public oFormoForm = CreateObject("MyForm")

Anyone have the same problem ?

My best

Nasib



 
I once had this problem, it's IE related I think. Copy to notepad before copying to VFP and line feeds should be fine.

Right now I don't have it with code in posts or embedded into CODE TGML.

Bye, Olaf.
 
Thanks Olaf, Mike.

I tried to copy/paste in Notepad, same problem.
Then I tried in Wordpad, it looked ok.

For now onward, I will use wordpad and copy/paste again in VFP editor. I will look at it in more details and post back.


My Best

Nasib


 
What browser are you using, what version?

I think what you describe it was an IE6 behaviour.

Wordpad handles linefeeds different from notepad, eg it also takes a single CHR(13) CR as a line feed, while notepad insists on CHR(13)+CHR(10) CRLF. So in fact I should not have mentioned notepad in your case.

There's another kind of error that can happen when copy&pasting from IE, that is somwhat the "opposite" of the bahviour to put all lines into one single line: Having a double line feed with each line, which also hurts of course when code has multiline vfp commands. And for temporarily pasting to notepad can be a cure, I think.

Bye, Olaf.
 
Hi Olaf:

I am using IE 8.0.7600.16385 and Windows 7 Ultimate Eng.
I had this problem on my old laptop Win XP as well.

Checking through debug.exe, my findings

Notepad: no indication of any CR/LF
WordPad: added CR/LF
VFP IDE Editor: no indication of any CR/LF

It looks like the special char at the end of line (most probably it is LF) if translaed to CR/LF by Wordpad and trucncated by Notepad.

my best
Nasib
 
Hi Olaf:

I just tried Copy/Paste with Mozilla Firefox and it seems to fix the problem. It was a great hit that the problem may lie in IE. Thanks a lot.

My Best

Nasib
 
Teh script extension "cfm" here at tek-tips suggestes it's a coldfusion based site, probably running on a linux or mac server, which would explain here the line feeds are either just CR or more probable LF.

Different browsers in different OSes seem to differ in how to provide copies of selected text, you may or may not call it a bug, perhaps IE even keeps it as it is originally, while Firefox Windows version makes it windows compliant CRLF.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top