Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 displaying all links in a given string
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

redbrad0
Advanced Member

USA
3725 Posts

Posted - 12 March 2001 :  15:08:38  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
I am trying to display all links in a given string and its stoping right at the end and I can not figure out why. This is the code I have, is there something better? or a better way of doing it?


Here is an example of the code at work...
http://207.21.203.31/test.asp




<%
Set HttpObj = Server.CreateObject("AspHTTP.Conn")
HTTPObj.Url = "http://207.21.203.31/contact/email.asp"
strResult = HTTPObj.GetURL


iCurrentLocation = 1
Do While InStr(iCurrentLocation, strResult, "http://", 1) <> 0
iLinkStart = InStr(iCurrentLocation, strResult, "http://", 1)
iLinkEnd = InStr(iLinkStart, strResult, "'", 1)
iLinkEnd2 = InStr(iLinkStart, strResult, """", 1)
iLinkEnd3 = InStr(iLinkStart, strResult, " ", 1)
if iLinkEnd2 < iLinkEnd then
iLinkEnd = iLinkEnd2
end if
if iLinkEnd3 < iLinkEnd then
iLinkEnd = iLinkEnd3
end if
If iLinkEnd = 0 Then iLinkEnd = Len(strResult) + 1
Select Case Mid(strResult, iLinkEnd - 1, 1)
Case ".", "!", "?"
iLinkEnd = iLinkEnd - 1
End Select
strOutput = strOutput & Mid(strResult, iCurrentLocation, iLinkStart - iCurrentLocation)
strLinkText = Mid(strResult, iLinkStart, iLinkEnd - iLinkStart)
Response.Write strLinkText & vbCrLf & "<br>"
iCurrentLocation = iLinkEnd
Response.Write vbCrLf & "<p>"
Loop
%>


Brad
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.23 seconds. Powered By: Snitz Forums 2000 Version 3.4.07