Results 1 to 15 of 15

Thread: cut and paste from forum post

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    779

    cut and paste from forum post

    when someone posts vb.net code with the line numbers, how can i cut and paste this code into my program without having to do it line by line?

  2. #2
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: cut and paste from forum post

    The workaround I usually do is:
    1. Copy the code and paste in Ms-Word
    2. Select all text and Click the Bullets & Numbering button to remove the numbers.
    3. Copy code and paste in Visual Studio.
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  3. #3
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: cut and paste from forum post

    The other thing I find people often speaking is that it works OK in Opera browser. i.e. Text is not copied with bullets/line numbers.
    (Though don't personally use Opera, so I can't be 100% sure. Maybe you could give it a try if it suits you.)
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  4. #4

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: cut and paste from forum post

    Thread moved to 'Forum Feedback', which is where questions about site usage etc belong

    A much simpler method is to press "Quote", as that shows the code without the tags working on it.

    The other thing I find people often speaking is that it works OK in Opera browser. i.e. Text is not copied with bullets/line numbers.
    Apparently it is just FireFox that has the issue, and IE is fine too.

    Previously it was all browsers, but an update of the tags fixed it for most of them.

  6. #6
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: cut and paste from forum post

    There used to be a VS 2005 plugin that you'd use to paste the vbcode tag code and it'd paste it without the line numbers, but that plug bit the dust or something a few years ago.

    Because of the line numbers, I still post code using the [code] [/code] tags instead of the [highlight=vb] [/highlight] tags
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  7. #7
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: cut and paste from forum post

    Quote Originally Posted by JuggaloBrotha View Post
    Because of the line numbers, I still post code using the [code] [/code] tags instead of the [highlight=vb] [/highlight] tags
    You certainly aren't the only one - lots of us do that

  8. #8
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: cut and paste from forum post

    Quote Originally Posted by si_the_geek View Post
    You certainly aren't the only one - lots of us do that
    Since you said it now works on all major webbrowsers except firefox, I wonder how much effort would it take to develop a plugin for Firefox that fixes this and add it to our codebank.
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  9. #9
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: cut and paste from forum post

    Apparently it shouldn't be too hard to alter the code highlighter so it works for all browsers... the problem is that most people here do VB etc rather than the web based language(s) that it uses, and of course any changes would have to be checked by the Admins who deal with it.

    A Firefox plugin would be a good work-around for long-term members, but it wouldn't be great for new members etc.

  10. #10
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: cut and paste from forum post

    Hey,

    .paul.'s Addin is fairly recent, and from what I understand, will do exactly what the OP is after. Have a look at it here:

    http://www.vbforums.com/showthread.php?t=543154

    Hope that helps!!

    Gary

  11. #11
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: cut and paste from forum post

    Or you first click on Quote button (at lower right end) of post, and from the text editor of following page, you can copy the code from quoted text. Just make sure you don't hit the submit button by any chance.
    Show Appreciation. Rate Posts.

  12. #12
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: cut and paste from forum post

    I wouldn't mind a FF plugin that just does it's thing automatically when something's copied to the clipboard.
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  13. #13
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: cut and paste from forum post

    Hey,

    That is essentially what the addin for Visual Studio provides, apart from the work is done on the paste, rather than the copy.

    Gary

  14. #14
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: cut and paste from forum post

    Quote Originally Posted by gep13 View Post
    Hey,

    That is essentially what the addin for Visual Studio provides, apart from the work is done on the paste, rather than the copy.

    Gary
    Yea, except that I use 3 versions of VS.Net (soon to be a 4th) and I even copy and paste code from the HighLight tags into NetBeans (Java editor) so I'd have to have 5 versions of the extension, when all I run is 1 version of FF so a FF add-on would make much more sense (to me at least).

    So I could go for a FF add-on
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  15. #15
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: cut and paste from forum post

    Ah, I see what you mean, fair point.

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width