Gider ikke køre sub?!
Hej.Jeg har denne Function:
Function addLinks(sInput, sTarget)
Dim sNew, sPunct
sPunct = "_-+=!?.,;:`~'""*^$%()[]{}<>|"
sNew = sInput
For Each sVal1 in Split(sNew, " ")
For Each sVal2 in Split(sVal1, vbcr)
For Each sVal3 in Split(sVal2, vblf)
For Each sVal4 in Split(sVal3, Chr(9))
bStop = FALSE
Do While (Not bStop)
If (Instr(sPunct, Left(sVal4, 1)) <> 0 And Len(sVal4) > 2) Then
sVal4 = Mid(sVal4, 2)
Else
bStop = TRUE
End If
Loop
bStop = FALSE
Do While (Not bStop)
If (Instr(sPunct, Right(sVal4, 1)) <> 0 And Len(sVal4) > 2) Then
sVal4 = Left(sVal4, Len(sVal4) - 1)
Else
bStop = TRUE
End If
Loop
If (LCase(Left(sVal4, 7) = "http://") Or LCase(Left(sVal4, 4) = "www.")) Then
If (LCase(Left(sVal4, 4) = "www.")) Then
If (sTarget = "") then
sNew = Replace(sNew, sVal4, "<A HREF=""http://" & sVal4 & """>" & sVal4 & "</A>")
Else
sNew = Replace(sNew, sVal4, "<A HREF=""http://" & sVal4 & """ TARGET=""" & sTarget & """>" & sVal4 & "</A>")
End If
Else
If (sTarget = "") then
sNew = Replace(sNew, sVal4, "<A HREF=""" & sVal4 & """>" & sVal4 & "</A>")
Else
sNew = Replace(sNew, sVal4, "<A HREF=""" & sVal4 & """ TARGET=""" & sTarget & """>" & sVal4 & "</A>")
End If
End If
End If
If (Instr(sVal4, "@") >= 2 And Instr(sVal4, ".") <> 0 And Len(sVal4) >= 5) Then
sNew = Replace(sNew, sVal4, "<A HREF=""mailto:" & sVal4 & """>" & sVal4 & "</A>")
End If
Next
Next
Next
Next
tekst = sNew
End Function
Som bliver kørt sådan her:
67> addLinks(tekst, "_blank")
Men men men men... jeg får denne fejl:
Der opstod en Microsoft VBScript-kompileringsfejl fejl '800a0414'
Der kan ikke bruges parenteser ved kald af en Sub
/itai/ed2/editpar.asp, linje 67
addLinks(tekst, "_blank")
-------------------------^