Results 1 to 3 of 3

Thread: Can't find error in code!

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    Maumelle, AR
    Posts
    624

    Can't find error in code!

    This keeps going to my error statement after one song is played. Can anyone find my error in code? I've included some notes it to help you follow it. Any help appreciated.

    Code:
    Private Sub Timer2_Timer()
    On Error GoTo Nomoreitems
    
    counter.Caption = Format$(songTime - (Now() - origTime), "n:ss")
    If Now() > origTime + songTime Then 'check for end of song
            Timer2.Enabled = False
            counter = ""
            Songtitle = ""
            Frequency = ""
            bitrate = ""
            If shuffle.Checked = True Then     'Shuffle Play is enabled
            ListView2.SelectedItem = ListView2.ListItems(random)  'select random item
            Else  'Shuffle Play is disabled
            ListView2.ListItems(MusicMaster.ListView2.SelectedItem.Index + 1).Selected = True
            End If
        
            'Load file information to player
    Let Songtitle = "*** " & ListView2.SelectedItem.Text & " ***"
    Let bitrate = ListView2.SelectedItem.SubItems(3) & " KBPS"
    Let Frequency = ListView2.SelectedItem.SubItems(4) & " KHZ"
    Let counter = ListView2.SelectedItem.SubItems(1)
     origTime = Now()
        songTime = "00:" & counter
        counter.Caption = Format$(songTime, "n:ss")
    Timer2.Enabled = True
            Call Playlister
            End If
            Exit Sub
            
    Nomoreitems:
    
    MsgBox "END OF PLAYLIST!"
    End Sub

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    try setting a breakpoint at the top of the sub, then step through the execution. You will be able to tell what line throws the error, and that will help us diagnose the problem.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    or, take out the error handling and see where the compiler stops ?

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