' start from here
'Private Const sURL As String = "http://localhost/player/player.asp?id="
Dim CurrID As Integer
Private Function NextURL(Optional Reset As Boolean = False) As String
If CurrID = 0 Or Reset Then CurrID = 16411
If CurrID = 16420 Then Exit Function
Const sURL As String = "http://localhost/player/player.asp?id="
'NextURL = sURL & CuurID
NextURL = sURL & CurrID
MsgBox "URL:" & NextURL
CurrID = CurrID + 1
MsgBox "CurrID" & CurrID
'Text2.Text = Inet1.OpenURL(CurrURL, icString)
' MsgBox "testing"
'End If
End Function
[B]' once i click the go button this function start with first url and should
keep chaing url by incrementing it untill it reaches end of the range[/B]
Private Sub Command3_Click()
Dim CurrURL As String
CurrURL = NextURL
'to reset
CurrURL = NextURL(True)
Text1.Text = CurrURL
MsgBox "CurrentUrl:" & CurrURL
MsgBox "nexturl:" & NextURL
Select Case Index
Case 0
If Text1.Text <> "" Then
[B]Text2.Text = Inet1.OpenURL(CurrURL, icString)[/B]
End If
Case 1
End
End Select
'MsgBox "testing"
Command4_Click
Command3_Click ' caling himself again
End Sub
Private Sub Command4_Click()
' It returns a string so just use it like:
'Text3.Text = GetLine2(Text2.Text, "mp3player.swf?playlist=", ".exe")
Text3.Text = "http://localhost/player/" & GetLine2(Text2.Text, "mp3player.swf?playlist=", ".exe")
Command5_Click
End Sub
Private Function GetLine2(ByVal sText As String, ByVal sStart As String, ByVal sEnd As String) As String
Dim lPos As Long, lEnd As String
lPos = InStr(1, sText, sStart, vbTextCompare)
If lPos Then
lEnd = InStr(lPos, sText, sEnd)
If lEnd Then
GetLine2 = Mid$(sText, lPos + Len(sStart), lEnd - (lPos + Len(sStart))) & sEnd
Else
GetLine2 = Mid$(sText, lPos + Len(sStart))
End If
End If
End Function
Private Sub Command5_Click()
Select Case Index
Case 0:
If Text3.Text <> "" Then
Text4.Text = Inet1.OpenURL(Text3.Text, icString)
End If
Case 1:
End
End Select
Command7_Click
End Sub
' this funcion needs to write to a text file
Private Sub Command7_Click()
'Dim Parser As New clsXMLParser
' Dim Node As clsXMLNode
'Dim Child As clsXMLNode
Dim fn As Long
'Dim i As Long
'Dim path As String
'Dim title As String
fn = FreeFile
Open "C:\albums.txt" For Append As #fn
'Yes. Use Print #fn instead of Write #fn
'Write #fn, Text4.Text
Print #fn, Text4.Text
Close #fn
[B]MsgBox " file written successfully to the file!"[/B]
' after this part i want the url get incremented and it getchecked in Command3_Click
End Sub