My current code goes trough a html code and finds all the url part that
has this type of pattern with bold part changing :
VB Code:
  1. Albums.asp?singerID=[B]1421[/B]

It outputs the result to mainlistbox shown in pic. What i want to do for each listbox item is the following:

1)Take first item in mainlistbox and construct its url like this:

VB Code:
  1. [url]http://localhost.com/Albums.asp?singerID=[/url][B]1421[/B]
]

2)Get the html code of

VB Code:
  1. [url]http://localhost.com/Albums.asp?singerID=[/url][B]1421[/B]
then look for the follwing pattern with the bold part is changing:

VB Code:
  1. ../Music/AlbumSongs.asp?AlbumId=[B]1918[/B]&Album=[B]life[/B]&Singer=[B]Andy[/B]&SingerID=[B]1421[/B]

pattern example:

VB Code:
  1. <tr bgcolor="#C0C0C0">
  2.                                 <td>
  3.                                 <a href=" ../Music/AlbumSongs.asp?AlbumId=1918&Album=life&Singer=Andy&SingerID=1421">
  4.                                 Check this Album</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  5.                                 Email to Friend -><a href="../../EmailAlbum.asp?AlbumID=1918">
  6.                                 <img border="0" src="../images/mail.gif" longdesc="Email This singers Albums to a Friend" alt="Email This singers Albums to a Friend" width="16" height="16"></a>&nbsp;
  7.                                 <br>
  8.                                 </td>
  9.  
  10. </tr>

3)adding them all to another newlistbox then we do the following for each items in this newly listbox

4)We take the first item from our newlistbox and construct its full url

and get its html :


VB Code:
  1. http://localhost/Music/AlbumSongs.asp?AlbumId=1918&Album=life&Singer=Andy&SingerID=1421

and we look for pattern like this and bold part changing again and them to thirdlistbox

VB Code:
  1. <a href="javascript:newWindow('../player/player.asp?id=[B]16295[/B]')">
after this we do the same for remaing items in our newlistbox after finishing the process for our first mainlisbox item we do the same process for the remaining items of our mainlistbox till we reach end of the mainlistbox. I be happy if some one show me how i can recursivly acomplish this task.Thanks


VB Code:
  1. Private Sub Command1_Click(Index As Integer)
  2.  
  3. Select Case Index
  4.     Case 0:
  5.         If txtURL.Text <> "" Then
  6.             RichTextBox1.Text = Inet1.OpenURL(txtURL.Text, icString)
  7.         End If
  8.    
  9.     Case 1:
  10.         End
  11. End Select
  12. End Sub
  13.  
  14.  
  15. Private Sub Command2_Click()
  16.  Dim sResult() As String, N As Long
  17.  
  18.     If GetLine(RichTextBox1.Text, "Albums.asp?SingerID=", "&Singer=", sResult) Then
  19.           For N = LBound(sResult) To UBound(sResult)
  20.             List1.AddItem sResult(N)
  21.               Text1.Text = Text1.Text & sResult(N) & vbCrLf
  22.         Next N
  23.  
  24.     Else
  25.         ' No occurances were found
  26.     End If
  27. End Sub
  28.  
  29. Private Function GetLine(ByVal sText As String, ByVal sStart As String, ByVal sEnd As String, ByRef sArr() As String) As Boolean
  30.     Dim lPos As Long, lEnd As Long, lCount As Long, sTemp() As String
  31.    
  32.     ReDim sTemp(100)
  33.    
  34.     lPos = InStr(1, sText, sStart, vbTextCompare)
  35.     Do While lPos
  36.         lEnd = InStr(lPos, sText, sEnd, vbTextCompare)
  37.         If lEnd Then
  38.             sTemp(lCount) = Mid$(sText, lPos, lEnd - lPos)
  39.             lPos = InStr(lEnd, sText, sStart, vbTextCompare)
  40.         Else
  41.             sTemp(lCount) = Mid$(sText, lPos)
  42.             lPos = 0
  43.         End If
  44.         lCount = lCount + 1
  45.         If lCount > UBound(sTemp) Then ReDim Preserve sTemp(100 + lCount)
  46.     Loop
  47.  
  48.     If lCount > 0 Then
  49.         ReDim Preserve sTemp(lCount - 1)
  50.         sArr = sTemp
  51.     End If
  52.     GetLine = lCount
  53. End Function