• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How does copy from code samples work?

 
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whenever I copy some code examples from a post, and paste it into my IDE (or text editor), there doesn't appear to be any linefeed characters...everything prints on one line.
Why is this?
Thanks!
Rob
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problems vary with the editor, I'm sure. Whenever I paste in text from a post I get a bunch o' tabs after the first line. Very annoying, since the reason I do it in the first place is to make the code more readable.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Back in the good old days, my preferred solution was to hit "edit" on the post I wanted to copy from - if you cut & paste from the edit screen, linefeeds are preserved, while cut & paste from the regular view does not. The key is, you could go to the edit screen even if you had no intent or authorization to edit a given post, since the system didn't require a password until you pressed "submit". You could also use this to discover what UBB and HTML codes had been used in someone else's post - very useful for learning. Now with the upgrade though, you can no longer get to the edit screen unless you are authorized to actually perform an edit. Which means it must be your own post, or you must be a sheriff or a bartender acting in your own form. Which ofcourse makes this trick of limited use to most people.
However, I just tried using Opera instead of IE, and found that I can cut and paste just fine there, with linefeeds preserved. So it may be worthwhile switching over - or at least, have Opera available on your system, and try it occasionally. Go to www.opera.com (duh) to download it. Enjoy.
[ January 10, 2002: Message edited by: Jim Yingst ]
 
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
WordPad preserve the linefeeds. You could paste it there then cut and paste to whereever from there. It is an Editor/IDE thing (JCreator/WordPad preserves Programmers File Editor/NotePad does not).
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Arrrg, this is driving me BONKERS!
Even when I try to copy code text from a post, so I can quote it in another post, and I paste it directly into the "Post A Reply" form's text field, it still prints all the lines in one row and I have to manually enter a return for each line.
This is the 21st century for god's sake, don't we have technology for these "complicated" editing problems?!?
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jim Yingst:
Back in the good old days, my preferred solution was to hit "edit" on the post I wanted to copy from - if you cut & paste from the edit screen, linefeeds are preserved, while cut & paste from the regular view does not. The key is, you could go to the edit screen even if you had no intent or authorization to edit a given post, since the system didn't require a password until you pressed "submit". You could also use this to discover what UBB and HTML codes had been used in someone else's post - very useful for learning. Now with the upgrade though, you can no longer get to the edit screen unless you are authorized to actually perform an edit. Which means it must be your own post, or you must be a sheriff or a bartender acting in your own form. Which ofcourse makes this trick of limited use to most people.


You can hit "Reply with Quote" button for this proposal. The text will be enclosed in QUOTE tags, but all inner formatting is preserved.
 
Jim Yingst
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah, good point. I never bothered with "Reply with quote" since I prefer to interleaven my responses within the text I'm quoting, and

tags don't really allow this. But clearly the button has other uses I hadn't considered.
[ January 10, 2002: Message edited by: Jim Yingst ]

 
reply
    Bookmark Topic Watch Topic
  • New Topic