Har leget lidt med det, og nedenstående burde samtidig korigere de mest forekomne indtastningsfejl :
<%
Function Max(input)
Dim I
Dim Highest
Highest = Null
For I = LBound(input) to UBound(input)
If IsNumeric(input(I)) Then
If CDbl(input(I)) > Highest Or IsNull(Highest) Then
Highest = CDbl(input(I))
End If
End If
Next
Max = Highest
End Function
Function web(Link)
Check1 = InStr(1, Link, "www")
Check2 = (InStr(1, Link, "http") + 3)
Check3 = InStr(1, Link, ":")
Check4 = InStr(1, Link, "/")
Check5 = InStr(1, Link, "//")
Length = int(len(Link) + 1)
if InStr(1, Link, ".") > 0 Then
If (left(link,7) = "
http://") Then
Link = Link
elseIF (Check1>0) Then
Link = "
http://" + Mid(Link, Check1, Length-Check1)
elseIf ((check2>3) Or (check3>0) Or (Check4>0) Or ((check5+1)>1)) Then
str = (Check2) & "," & (Check3) & "," & (Check4) & "," & (Check5+1)
Start = Split(str, ",", -1, 1)
Link = "
http://" + Mid(Link, (Max(Start)+1), Length-(Max(Start)+1))
else
Link = "
http://" + Mid(Link, 1, Length-1)
End If
web = Link
End If
web = Link
End Function
streng = "http:/eksperten.dk"
response.write web(streng)
-grunken
%>