Results 1 to 14 of 14

Thread: New VBcode

Hybrid View

  1. #1

    Thread Starter
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    New VBcode

    This is wierd, look at all the pretty colors
    I don't like scroll bars
    vb Code:
    1. Private Function ExtractText(fulltext As String, tags As clsTags)
    2.     fulltext = "This sucks"
    3.     'extracts and returns the text between the tags
    4.     Dim P1 As Integer, P2 As Integer
    5.     P1 = InStr(fulltext, tags.Starting.char)
    6.     P2 = InStr(P1 + 1, fulltext, tags.Ending.char)
    7.     ExtractText = Mid(fulltext, P1 + 1, P2 - P1 - 1)
    8. End Function

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: New VBcode

    Quote Originally Posted by moeur
    This is wierd, look at all the pretty colors
    I don't like scroll bars
    Neither do I but they don't care really... I'm testing something here as well, btw.
    vb Code:
    1. Dim colRandom As New Collection
    2. Dim intTry As Integer
    3.  
    4. Randomize
    5.  
    6. On Error Resume Next
    7.  
    8. Do Until colRandom.Count = 6
    9.     ' Generate the random number
    10.     intTry = Int(Rnd * 16 + 1)
    11.     ' Attempt To add it To the collection along with a matching key
    12.     colRandom.Add intTry, CStr(intTry)
    13.     If Err.Number = 457 Then
    14.         ' The key is already In the collection so it isn't added again
    15.     End If
    16. Loop
    17.  
    18. For intTry = 1 To 6
    19.     Debug.Print colRandom(intTry)
    20. Next

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: New VBcode

    Mind if I join in?
    vb Code:
    1. Dim x As Integer
    c# Code:
    1. int x;
    Hmmm... it does work with C# too. Cool!
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

  5. #5
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: New VBcode

    I get all of the code... with the line numbers on alternate lines.

    Useless.

  6. #6

  7. #7
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: New VBcode

    It comes out like this:

    Code:
       1.
          Dim colRandom As New Collection
       2.
          Dim intTry As Integer
       3.
           
       4.
          Randomize
       5.
           
       6.
          On Error Resume Next
       7.
           
       8.
          Do Until colRandom.Count = 6
       9.
              ' Generate the random number
      10.
              intTry = Int(Rnd * 16 + 1)
      11.
              ' Attempt To add it To the collection along with a matching key
      12.
              colRandom.Add intTry, CStr(intTry)
      13.
              If Err.Number = 457 Then
      14.
                  ' The key is already In the collection so it isn't added again
      15.
              End If
      16.
          Loop
      17.
           
      18.
          For intTry = 1 To 6
      19.
              Debug.Print colRandom(intTry)
      20.
          Next

  8. #8

  9. #9
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: New VBcode

    Hmmm.... if this is how it's going to be.... I'll continue to use the [code][/code] tags....

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  10. #10
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: New VBcode

    Quote Originally Posted by techgnome
    Hmmm.... if this is how it's going to be.... I'll continue to use the [code][/code] tags....

    -tg
    That exactly what I use - [CODE] tags...

    edit: that's weird - I typed CODE in UPPER case but it was posed in lower case...

  11. #11
    Frenzied Member TheBigB's Avatar
    Join Date
    Mar 2006
    Location
    *Stack Trace*
    Posts
    1,511

    Re: New VBcode

    Aight... The brown for strings is ugly; the green is a little to light; i don't like the pink numbers; and what are the chemical green brackets for?
    Delete it. They just clutter threads anyway.

  12. #12
    Frenzied Member TheBigB's Avatar
    Join Date
    Mar 2006
    Location
    *Stack Trace*
    Posts
    1,511

    Re: New VBcode

    @moeur: you might want to upgrade your singnature
    it still has the good old [vbcode] tags
    Delete it. They just clutter threads anyway.

  13. #13
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: New VBcode

    I've been getting copied code on one line too. To get around that I quote the post that contains the code first to open it in the editor, then copy the code directly from between the HIGHLIGHT tags in the editor. It's a pain to have to use a workaround but I think these new HIGHLIGHT tags are a vBulletin thing, not a VBF thing.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  14. #14
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: New VBcode

    I know it's a pain so I'm using plain CODE tags and that's the end of it.
    I hate textbox with scrollbars but since they appear with or without the highlighting I'd rather not use highlighting at all with all those silly colors.
    The way this new highlighter is desined is really rediculous.

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