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!
Printable View
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!
Start with your code.
Blame the USER! :)
Here's the code!
Can you think of any more features or give me a tip where I should go with it?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
Thanks for all the great help!
Looks *PERFECT* to me. :) :thumb:
ps. see the SOB thread...
VB Code:
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 & " [HL="#FFFF80"]to [/HL]figure [HL="#FFFF80"]out [/HL]what should be done: to kill " & Nick3 & " or just cause a ban.", _ vbInformation, "VBForums Latest Headlines" Unload Me End Sub
Ooooh! Unbelievable! THANKS!
My name is Jake :mad:
sorry i can't help! I know nothing in vb6. :(
here merri my version about random name. Done in vb.net.
VB Code:
Dim r As New Random() Dim a As New ArrayList() Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim names() As String = {"mendhak", "Jacob Roman", _ "eyeRmonkey", "wossname", "NoteMe", "Pino", _ "MartinLiss", "dee-u", "RobDog888", "Valleysboy1978", _ "oceanebelle", "Gary Campbell", "|2eM!x", "baja_yu", _ "mar_zim", "-TPM-", "demotivater", "grilkip", "brad jones", "cryptblade", "visualad", "merri"} Dim item, randomname As String a.Clear() For Each item In names randomname = names(r.Next(1, names.Length)) If a.Count > 0 Then If looptoarray(randomname) = False Then a.Add(randomname) End If Else a.Add(randomname) End If Next MessageBox.Show(a(0).ToString & " thinks " & a(1).ToString & " is very good in programming. However, " & a(2).ToString & " greatly disagrees with this." & _ " 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) End Sub Function looptoarray(ByVal m As String) As Boolean Dim i As Integer For i = 0 To a.Count - 1 If a.Item(i).ToString = m Then Return True End If Next End Function
quite funny though :D
For the last time, in the name of God, MY NAME IS JAKE!!! :mad:
Thank you ;) :bigyello:
you're welcome :thumb:Quote:
Originally Posted by Jacob Roman
How did you come up with that list? :) I'm flattered to see my name listed. :cool:Quote:
Originally Posted by Merri
Same here :thumb:
Yeah me too JR
*sniffles*
That's the most beautiful thing I've ever seen.
Well, I am perferctly content to be excluded. Thank you. I've endeared enough trauma this week.
Cause a ban?
What if Nick1 is male?Quote:
If LenB(Nick1) = LenB(Nick2) Then If InStr(Nick1, Nick2) = 1 Then Nick2 = "she"
Unlikely.Quote:
Originally Posted by Merrion
Could you plz suggest a better wording?!? THANKS!Quote:
Originally Posted by mendhak
Sorry, never seen you before! :/Quote:
Originally Posted by dglienna
I used a random word generator. Cool huh?Quote:
Originally Posted by dee-u
Uh... then... you're not on the list, right?Quote:
Originally Posted by Jacob Roman
I'm flattered to see my name not on the list.....Quote:
Originally Posted by dee-u
I see a problem, the code sees to be mising the term "I Love My Vans", that might be your problem ;
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")
my pants are better than yours
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!
to kill Jacob Roman or just ban him.
Sweet and simple.