Results 1 to 25 of 25

Thread: Strip Numbers from VBForum Code

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    46

    Strip Numbers from VBForum Code

    Howdy all;

    I found a link a while ago that strips the line numbering from the Code samples on this site, but have not been able to find it again. Does anyone still have the link?

  2. #2
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Strip Numbers from VBForum Code

    A link that strips the line numbers from the code? That's a very powerful link. Are you sure it's a link that strips line numbers or a link to a post that tells you how to do it?

    You can always Quote the post with the VBCode and that will remove the line numbers and then you will need to copy out the code you want from the quoted post.

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    46

    Re: Strip Numbers from VBForum Code

    jmsrickland, never thought of that. Thanks.

    Yep, there is a link for an html page that, I believe funnels vbforum pages through it, so when you see the page, you get all the code without the numbers.

    I m still searching cd's ( I reimaged my pc about 3 months ago), so if no one else has it, and I find it I'll post here.

  4. #4
    Lively Member
    Join Date
    Dec 2007
    Posts
    77

    Re: Strip Numbers from VBForum Code

    I don't know who posted this code, but it works for me.

    Copy the code you want from this forum into the clipboard,run the following code, and then paste it to notepad or directly in you app.

    Code:
    Private Sub Form_Load()
        Dim myarr() As String
        Dim i As Integer
        
        myarr = Split(Clipboard.GetText, vbNewLine)
        
        For i = UBound(myarr) To 0 Step -1
            If IsNumeric(myarr(i)) Then
                myarr(i) = ""
            ElseIf (myarr(i)) = "#" Then
                myarr(i) = ""
            End If
        Next i
          
          Clipboard.Clear
          Clipboard.SetText Replace(Join(myarr, vbNewLine), vbLf & vbCr, "")
          Unload Me
    End Sub
    I modified the original code to fit my purposes so I don't know how much of it is mine...
    Last edited by TheOldNewbie; Jul 6th, 2008 at 12:13 PM.

  5. #5

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    46

    Re: Strip Numbers from VBForum Code

    TheOldNewbie - brilliant. Shows you where my mind is. I am such a lazy putz...

    AAAANNNDDD ROLF. So now NO posts have line numbers in it. Ok what happened. I am trying to set The OldNewbie's code and I can't find any post with the numbers.. so.. the great vbGod flipped the swtich?

  6. #6
    Lively Member
    Join Date
    Dec 2007
    Posts
    77

    Re: Strip Numbers from VBForum Code

    Quote Originally Posted by peteleeb
    AAAANNNDDD ROLF. So now NO posts have line numbers in it. Ok what happened. I am trying to set The OldNewbie's code and I can't find any post with the numbers.. so.. the great vbGod flipped the swtich?
    Hint....Put line numbers in your code and try it...hehe.


  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Strip Numbers from VBForum Code

    MartinLiss wrote a utility in Utility Bank forum that does just that. The line number have been a known issue for about a year now.

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

    Utility:
    http://www.vbforums.com/showthread.php?t=458328
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  8. #8
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Strip Numbers from VBForum Code

    Well, one way to solve this problem is that no one uses VBCode. I don't use it, never liked it in the first place, and never could understand why other people use it. It's a pain in the $%^@ to extact out the code you want. Why doesn't everyone just use the [CODE] tags instead? It would sure make things alot simplier. That's my opinion.

  9. #9
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Strip Numbers from VBForum Code

    Its not the vbcode tags as those have been replaced with highlight tags "[highlight=vb.net]" is the actual tag.

    The new code parser perform much more colouring not just for VB but all of .NET languages as well as many other non-.net languages
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  10. #10
    PowerPoster Ellis Dee's Avatar
    Join Date
    Mar 2007
    Location
    New England
    Posts
    3,530

    Re: Strip Numbers from VBForum Code

    Quote Originally Posted by jmsrickland
    Why doesn't everyone just use the [CODE] tags instead? It would sure make things alot simplier. That's my opinion.
    I use both. For pseudocode and descriptive code snippets, I use highlight tags. For code I intend somebody to actually use, I use normal code tags for ease of copying.

    The exception is in the CodeBank. I always use highlight tags there, though I'm not sure why.

  11. #11
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Strip Numbers from VBForum Code

    I rarely use highlight tags as I really dont care about the colouring (besides there are some keywords still missing and C# code has a bug in it). I tried using them but its just longer text to type and I'd rather use something that is more user friendly for a better user experience.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  12. #12
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Strip Numbers from VBForum Code

    I think I got to dislike the "[highlight=vb.net]" (thought it was VBCode tags) before I knew about just quoting the post and then do a copy paste of the code I wanted. Even then, when I see VB code within those tags I still don't like it because the cloring is very distracting and sometimes I can't even see the colored text it is so faint (a very very light green) it hardly shows up on my PC monitor. Maybe it's my color settings but I am not going to mess with those settings since I spent too much time getting them just right and everything else in color appears to be very good with the exception of some of the colors in the VB code.

  13. #13
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Strip Numbers from VBForum Code

    Also check the most simplest way to do it....

    in my signature...
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  14. #14
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Strip Numbers from VBForum Code

    Thats a good trick ks but if you use Martins utility its much less steps and easier
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  15. #15
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Strip Numbers from VBForum Code

    Quote Originally Posted by RobDog888
    Thats a good trick ks but if you use Martins utility its much less steps and easier
    Yeah that is a good trick

    Well, since it is coming from you, then I'll definitely check his utility
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  16. #16
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Strip Numbers from VBForum Code

    I'll take your word for it that the one made by MartinLiss is as good as you say it but I see one problem. Not everyone has Word. I don't, so I can't use it. I'm not trying to be disrespectful but I think it should have been written with out any secondary application needed.

  17. #17
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Strip Numbers from VBForum Code

    You guys can read the posts in the feedback forum thread I linked to in my post for feedback on it and also other workarounds.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  18. #18
    Addicted Member Veritas2.0's Avatar
    Join Date
    May 2008
    Posts
    181

    Re: Strip Numbers from VBForum Code

    This is actually a problem? I can copy the code people have used the highlight tags on directly from here to vb.
    Simple little bugs 13 : Me 1

    Law of Bugs - That one bug you missed will be found almost immediately, by your customer.

    I wonder if anyone has ever asked for a User Surly interface?

  19. #19
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Strip Numbers from VBForum Code

    Yes you can copy them but the line numbers come along with it and an extra line inbetween.

    Thread Moved
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  20. #20
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Strip Numbers from VBForum Code

    I think the simplest way is to simply hit the "Quote" button on the post with the code.

    Then, from the Quoted section, just copy the code, and cancel out of the Quote.

  21. #21
    Lively Member
    Join Date
    Dec 2007
    Posts
    77

    Re: Strip Numbers from VBForum Code

    To each his own, but I liked mine best.I compiled mine to an EXE and put a shortcut in the taskbar.

    When I wanted to copy some code with numbers, I would copy the code,hit the shortcut, and then paste it to my code window.Only 3 steps.1 more than a simple copy/paste.

    But that's just me.

  22. #22
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Strip Numbers from VBForum Code

    Quote Originally Posted by Hack
    I think the simplest way is to simply hit the "Quote" button on the post with the code.

    Then, from the Quoted section, just copy the code, and cancel out of the Quote.
    How can that be eaiser then the standard Copy/Paste operation? The utility intercepts the action and fixes it on the fly. No quoting or other workarounds. If you havent tried it you really should.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  23. #23
    Lively Member
    Join Date
    Dec 2007
    Posts
    77

    Re: Strip Numbers from VBForum Code

    Quote Originally Posted by RobDog888
    How can that be eaiser then the standard Copy/Paste operation? The utility intercepts the action and fixes it on the fly. No quoting or other workarounds. If you havent tried it you really should.
    Originally Posted by Hack
    I think the simplest way is to simply hit the "Quote" button on the post with the code.

    Then, from the Quoted section, just copy the code, and cancel out of the Quote.

    1.Hit the "Quote"
    2.Copy the code
    3.Paste the code
    4.Cancel out "Quote"

    I may be looking at it incorrectly but I count 4 steps to my 3.

    But like I said , that's only me...

  24. #24
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Strip Numbers from VBForum Code

    The utility...

    • Copy
    • Paste


    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  25. #25
    Lively Member
    Join Date
    Dec 2007
    Posts
    77

    Re: Strip Numbers from VBForum Code

    Quote Originally Posted by RobDog888
    The utility...

    • Copy
    • Paste


    Touche'.....


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