how do I copy the code with line numbers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Leon Pearlman
    New Member
    • Dec 2010
    • 1

    how do I copy the code with line numbers

    I am trying to copy my code with line numbers, but when I select all and right click the code there is no option copy in html. can you help, thank you?
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Line numbers are not part of the code so there's nothing to copy. Just copy your selection and add the line numbers to the copy but realize that it won't compile any longer.

    Comment

    • donbock
      Recognized Expert Top Contributor
      • Mar 2008
      • 2427

      #3
      I assume you are asking how to post source code in this forum.

      Look here. A short-cut technique is to paste the lines of code (with no line numbers), select the lines of code, and then press the # button at the top of the post-entry window.

      Notice that line numbering in your post always starts from 1, so line numbers in your post are typically different than line numbers in your actual source code. Compiler messages typically indicate the relevant line number. It is very helpful if you somehow indicate which line in your post corresponds to the line indicated in the message. You can use the Preview button to see what line numbers will be seen by people reading your post.

      Comment

      Working...