Results 1 to 4 of 4

Thread: CHANGE WEB SITES

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 1999
    Posts
    118
    I am tryig to change web pages randomly , the url 's are in text boxes. I
    know how to change pages but I wanted to use one timer and change the
    interval so it would move them at different times. Any ideas or sampe code
    would be appreciated.
    Thanks


  2. #2
    Hyperactive Member scuzymoto's Avatar
    Join Date
    Aug 1999
    Location
    Washington State
    Posts
    316
    Can you use a radom number generator to keep changing the interval of the timer?

    'gets a random number somwhere between 1 second and 10 seconds for the timer interval

    Radomize
    Timer1.Interval = Long((10000 * Rnd) + 1000)

    SCUZ

  3. #3
    Guest
    use an incrementin counter type thingy, and a select case or an If statement.


    Code:
    Dim CountThis As Integer ' put this in the gen. declarations
    
    Private Sub Command1_Click()
    Select Case CountThis
    Case 0
    txtUrl = "http://www.vb-world.net"
    Case 1
    txtUrl = "http://forums.vb-world.net"
    Case 2
    txtUrl = "http://www.vbapi.com"
    Case 3
    txtUrl = "http://msdn.microsoft.com"
    'Case etc. etc.
    End Select
    CountThis = CountThis + 1
    ' only use 1 form of this code, the above is for the select case the bottom is for If...Else
    
    If CountThis = 0 Then
    txtUrl = "http://www.vb-world.net"
    ElseIf CountThis = 1 Then
    ' etc.
    End If
    ' I like the select case much better
    End Sub

  4. #4
    Guest
    oh.. that will not really be random....

    but you can somehow limit the size of the nubers generated with a randon num. gen., and still use the select case...

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