Redim Preserve problems

Why can't I use Redim Preserve in my script?

It works on IIS and another webhotel then i got now.

The webhotel i got now uses Sun Java System Active Server Pages tho.

I get the error:

Error Type:

Sun ONE ASP VBScript runtime (0x800A000D)

Type mismatch

Don't this works on Sun or can u write something else?

[357 byte] By [Meathook] at [2007-11-26 11:43:15]
# 1
Redim preserve works with Sun Java System Active Server Pages. In fact we use it a lot in our admin console scripts. You must have some error in the script that is being ignored by IIS while ASP Server fails to run it.
Sultal at 2007-7-7 11:50:45 > top of Java-index,Web & Directory Servers,Web Servers...
# 2

[nobr]Here is the function and its always getting error on the redim preseve lines:

function funcKapa(strText)

Dim arrText, attTextNy

strText = Replace(strText,"<br>","<br> ")

arrText = Split(strText, " ")

j = 0

For i = 0 To UBound(arrText)

If Len(arrText(i)) > 35 Then

If InStr(arrText(i),"http") Or InStr(arrText(i),"https") Or InStr(arrText(i),"ftp") Then

Redim Preserve arrTextNy(j)

arrTextNy(j) = arrText(i)

Else

Do While Len(arrText(i)) > 35

Redim Preserve arrTextNy(j)

arrTextNy(j) = Left(arrText(i), 35)

j = j + 1

arrText(i) = Mid(arrText(i), 36)

If Len(arrText(i)) < 35 Then

j = j + 1

Redim Preserve arrTextNy(j)

arrTextNy(j) = arrText(i)

End If

Loop

End If

Else

Redim Preserve arrTextNy(j)

arrTextNy(j) = arrText(i)

End If

j = j + 1

Next

funcKapa = Join(arrTextNy)

End function

[/nobr]

Meathook at 2007-7-7 11:50:45 > top of Java-index,Web & Directory Servers,Web Servers...
# 3
Hi,Try width Dim Preserve hat the beginning of the function before you use ReDim Preserve
toze at 2007-7-7 11:50:46 > top of Java-index,Web & Directory Servers,Web Servers...