EDIT: New Problem!!!! How can I make VB6 randomly pick a URL from a list? I have the list allready loaded into vb6, but I have NO idea how to make it pick a random one. eg. Code (Text): Private Sub Timer2_Timer() Dim answerB As Integer Dim numeventsB As Integer numeventsB = lblNumberB If Not Len(txtURL.Text) <= 0 Then strHTML = Form2.gluraks.GetWrapper(AHAHAHHAHAHAHA) End If If InStr(1, strHTML, "Somthing Has") Then txtLog.AddItem "Random Event Gotten!", 0 answerB = numeventsB + 1 lblNumberB.Caption = answer End Sub *AHAHAHAHAHAHAH = A random URL from my list. Thanks, Oddworth I'm blonde. How do I use the Tabs control in vb6? I can make the tabs, but I have NO idea how ot use them. thanks, Oddworth
to use tabs you insert it into your program. You then select a tab and put whatever you want on it. Then click on the other tab and put what you want on it. To add tabs go to the property pages of the tab control. Pm me if you need help and if i helped you+rep is apprciated ~thanks
you mean, all yo uhave to do Is drag things onto them? THNAKS! +rep Post #2: friendly bump becaus eof new problem. EDIT: Sorry for double post Oddworth - You don't bump a post with consecutive posts... not to mention... we don't bump posts here. - Marlene
OK i just am taking this off the top of my head. Code (Text): Dim inturl as integer inturl = rand * 100 'or how many urls in your list If inturl = 1 then httpwrapper.getwrpaer(http://www.neopets .com/explore) If inturl = 2 httpwrapper.getwrpaaer(http://www.neopets .com/adopt) If you are doing it from a list I will ad that later Rand MAY be misspelled
my friend helped me with this, but I need a function for "CreateRandNumber" Code (Text): Private Sub Timer2_Timer() Dim i As Integer Dim numeventsB As Integer numeventsB = lblNumberB If Not Len(txtURL.Text) <= 0 Then i = CreateRandNumber(0, URLlist.ListCount) strList = URLlist.List(i) strHTML = Form2.gluraks.GetWrapper(strList) End If If InStr(1, strHTML, "Neopets") Then txtLog.AddItem "TEST (Success)", 0 numeventsB = numeventsB + 1 lblNumberB.Caption = numeventsB End If End Sub Thanks, Oddworth
Here is it: Code (Text): Public Function CreateRandNumber(ByVal Low As Long, ByVal High As Long) As Long Randomize CreateRandNumber = Int(Math.Rnd() * ((High + 1) - Low) + Low) End Function It should work