Results 1 to 26 of 26

Thread: A problem I've never had before

  1. #1

    Thread Starter
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    A problem I've never had before

    I have a problem in my code. It seems to be flawless. I've spent the last two weeks trying to find a bug or other errorneus behavior. I just can't find it. Can anyone point me where I should look for them?

    Thanks in advance!

  2. #2

  3. #3
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: A problem I've never had before

    Blame the USER!

  4. #4

    Thread Starter
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: A problem I've never had before

    Here's the code!

    Code:
    Option Explicit
    Private Function GetRandomNick() As String
        Dim A As Long, NickList() As Variant
        NickList = Array("mendhak", "Jacob Roman", _
            "eyeRmonkey", "wossname", "NoteMe", "Pino", _
            "MartinLiss", "dee-u", "RobDog888", "Valleysboy1978", _
            "oceanebelle", "Gary Campbell", "|2eM!x", "baja_yu", _
            "mar_zim", "-TPM-", "demotivater", "grilkip")
        Randomize
        GetRandomNick = CStr(NickList(Int(Rnd * (UBound(NickList) + 1))))
    End Function
    Private Sub Form_Load()
        Dim Nick1 As String, Nick2 As String, Nick3 As String
        Nick1 = GetRandomNick: Nick2 = GetRandomNick: Nick3 = GetRandomNick
        If LenB(Nick1) = LenB(Nick2) Then If InStr(Nick1, Nick2) = 1 Then Nick2 = "she"
        MsgBox Nick1 & " thinks " & Nick2 & " is very good in programming. However, " & Nick3 & " greatly disagrees with this." & _
            " It is now up to " & Nick1 & " figure what should be done: to kill " & Nick3 & " or just cause a ban.", _
            vbInformation, "VBForums Latest Headlines"
        Unload Me
    End Sub
    Can you think of any more features or give me a tip where I should go with it?

    Thanks for all the great help!

  5. #5
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: A problem I've never had before

    Looks *PERFECT* to me.

    ps. see the SOB thread...

  6. #6
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: A problem I've never had before

    VB Code:
    1. Private Sub Form_Load()
    2.     Dim Nick1 As String, Nick2 As String, Nick3 As String
    3.     Nick1 = GetRandomNick: Nick2 = GetRandomNick: Nick3 = GetRandomNick
    4.     If LenB(Nick1) = LenB(Nick2) Then If InStr(Nick1, Nick2) = 1 Then Nick2 = "she"
    5.     MsgBox Nick1 & " thinks " & Nick2 & " is very good in programming. However, " & Nick3 & " greatly disagrees with this." & _
    6.         " It is now up to " & Nick1 & " [HL="#FFFF80"]to [/HL]figure [HL="#FFFF80"]out [/HL]what should be done: to kill " & Nick3 & " or just cause a ban.", _
    7.         vbInformation, "VBForums Latest Headlines"
    8.     Unload Me
    9. End Sub

  7. #7

    Thread Starter
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: A problem I've never had before

    Ooooh! Unbelievable! THANKS!

  8. #8
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: A problem I've never had before

    My name is Jake

  9. #9
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    Re: A problem I've never had before

    sorry i can't help! I know nothing in vb6.

  10. #10
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    Re: A problem I've never had before

    here merri my version about random name. Done in vb.net.
    VB Code:
    1. Dim r As New Random()
    2.     Dim a As New ArrayList()
    3.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    4.         Dim names() As String = {"mendhak", "Jacob Roman", _
    5.                 "eyeRmonkey", "wossname", "NoteMe", "Pino", _
    6.                 "MartinLiss", "dee-u", "RobDog888", "Valleysboy1978", _
    7.                 "oceanebelle", "Gary Campbell", "|2eM!x", "baja_yu", _
    8.                 "mar_zim", "-TPM-", "demotivater", "grilkip", "brad jones", "cryptblade", "visualad", "merri"}
    9.         Dim item, randomname As String
    10.         a.Clear()
    11.         For Each item In names
    12.             randomname = names(r.Next(1, names.Length))
    13.             If a.Count > 0 Then
    14.                 If looptoarray(randomname) = False Then
    15.                     a.Add(randomname)
    16.                 End If
    17.             Else
    18.                 a.Add(randomname)
    19.             End If
    20.         Next
    21.  
    22.         MessageBox.Show(a(0).ToString & " thinks " & a(1).ToString & " is very good in programming. However, " & a(2).ToString & " greatly disagrees with this." & _
    23.         " It is now up to " & a(3).ToString & " figure what should be done: to kill " & a(4).ToString & " or just cause a ban.", "VBForums Headlines", MessageBoxButtons.OK, MessageBoxIcon.Information)
    24.     End Sub
    25.  
    26.     Function looptoarray(ByVal m As String) As Boolean
    27.         Dim i As Integer
    28.         For i = 0 To a.Count - 1
    29.             If a.Item(i).ToString = m Then
    30.                 Return True
    31.             End If
    32.         Next
    33.     End Function

    quite funny though
    Attached Images Attached Images  

  11. #11
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: A problem I've never had before

    For the last time, in the name of God, MY NAME IS JAKE!!!

    Thank you

  12. #12
    Hyperactive Member fret's Avatar
    Join Date
    Sep 2004
    Posts
    472

    Re: A problem I've never had before

    Quote Originally Posted by Jacob Roman
    Thank you
    you're welcome

  13. #13
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: A problem I've never had before

    Quote Originally Posted by Merri
    Here's the code!

    Code:
    Option Explicit
    Private Function GetRandomNick() As String
        Dim A As Long, NickList() As Variant
        NickList = Array("mendhak", "Jacob Roman", _
            "eyeRmonkey", "wossname", "NoteMe", "Pino", _
            "MartinLiss", "dee-u", "RobDog888", "Valleysboy1978", _
            "oceanebelle", "Gary Campbell", "|2eM!x", "baja_yu", _
            "mar_zim", "-TPM-", "demotivater", "grilkip")
        Randomize
        GetRandomNick = CStr(NickList(Int(Rnd * (UBound(NickList) + 1))))
    End Function
    Private Sub Form_Load()
        Dim Nick1 As String, Nick2 As String, Nick3 As String
        Nick1 = GetRandomNick: Nick2 = GetRandomNick: Nick3 = GetRandomNick
        If LenB(Nick1) = LenB(Nick2) Then If InStr(Nick1, Nick2) = 1 Then Nick2 = "she"
        MsgBox Nick1 & " thinks " & Nick2 & " is very good in programming. However, " & Nick3 & " greatly disagrees with this." & _
            " It is now up to " & Nick1 & " figure what should be done: to kill " & Nick3 & " or just cause a ban.", _
            vbInformation, "VBForums Latest Headlines"
        Unload Me
    End Sub
    Can you think of any more features or give me a tip where I should go with it?

    Thanks for all the great help!
    How did you come up with that list? I'm flattered to see my name listed.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  14. #14
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: A problem I've never had before

    Same here

  15. #15
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: A problem I've never had before

    Yeah me too JR

  16. #16
    Fanatic Member demotivater's Avatar
    Join Date
    Jun 2002
    Location
    is everything
    Posts
    627

    Re: A problem I've never had before

    *sniffles*
    That's the most beautiful thing I've ever seen.
    Here's to us!
    Who's like us?
    Darned few, and they're all dead!

  17. #17
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: A problem I've never had before

    Well, I am perferctly content to be excluded. Thank you. I've endeared enough trauma this week.

  18. #18
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: A problem I've never had before

    Cause a ban?

  19. #19
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: A problem I've never had before

    If LenB(Nick1) = LenB(Nick2) Then If InStr(Nick1, Nick2) = 1 Then Nick2 = "she"
    What if Nick1 is male?

  20. #20

    Thread Starter
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: A problem I've never had before

    Quote Originally Posted by Merrion
    What if Nick1 is male?
    Unlikely.

    Quote Originally Posted by mendhak
    Cause a ban?
    Could you plz suggest a better wording?!? THANKS!

    Quote Originally Posted by dglienna
    Well, I am perferctly content to be excluded. Thank you. I've endeared enough trauma this week.
    Sorry, never seen you before! :/

    Quote Originally Posted by dee-u
    How did you come up with that list?
    I used a random word generator. Cool huh?

    Quote Originally Posted by Jacob Roman
    MY NAME IS JAKE!!!
    Uh... then... you're not on the list, right?

  21. #21
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: A problem I've never had before

    Quote Originally Posted by dee-u
    How did you come up with that list? I'm flattered to see my name listed.
    I'm flattered to see my name not on the list.....

  22. #22
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Re: A problem I've never had before

    I see a problem, the code sees to be mising the term "I Love My Vans", that might be your problem ;

  23. #23

    Thread Starter
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: A problem I've never had before

    Add "I_Love_My_Pants" to the list... done. Thanks!

    Code:
        NickList = Array("mendhak", "Jacob Roman", _
            "eyeRmonkey", "wossname", "NoteMe", "Pino", _
            "MartinLiss", "dee-u", "RobDog888", "Valleysboy1978", _
            "oceanebelle", "Gary Campbell", "|2eM!x", "baja_yu", _
            "mar_zim", "-TPM-", "demotivater", "grilkip", "dglienna", _
            "I_Love_My_Pants", "timeshifter", "Merrion", "fret", _
            "brad jones", "crptblade", "visualAd", "Most of the Crowd")
    Last edited by Merri; Aug 20th, 2005 at 06:11 PM.

  24. #24
    Fanatic Member
    Join Date
    May 2005
    Posts
    898

    Re: A problem I've never had before

    my pants are better than yours
    "so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman

  25. #25

    Thread Starter
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: A problem I've never had before

    Did you really come to Finland, find out where I live, get into my house without me knowing it... just to check what kind of pants I have?

    Lame!

  26. #26
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: A problem I've never had before

    to kill Jacob Roman or just ban him.

    Sweet and simple.

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