Dim arrKakID
arrKakID = split(request.Cokies("redigera") ,",")
for i = 1 to ubound arrKakID
if cint(arrKakID(i)) = cint(RS("ReplyID")) then
Response.Write Request.Cokies("redigera") & "Du får redigera"
next
Men jag får följande fel:
Kompileringsfel i Microsoft VBScript (0x800A0401)
Slut på programsats förväntas.
/Hemsidor/GlobalaForeningen/Forum/forhand.asp, line 74, column 20
for i = 1 to ubound arrKakID
-------------------^
Dim arrKakID
arrKakID = split(request.Cookies("redigera") ,",")
for i = 0 to ubound (arrKakID)
if cint(arrKakID(i)) = cint(RS("ReplyID")) then
Response.Write Request.Cookies("redigera") & "Du får redigera"
next
------------------ essentitia preter non sans multiplicandum
När jag skrev som du visade mig fick jag error: oväntat NEXT
Om jag skriver så här:
arrKakID = split(request.Cokies("redigera") ,",")
for i = 0 to ubound (arrKakID)
if cint(arrKakID(i)) = cint(RS("ReplyID")) then Response.Write Request.Cokies("redigera") & "Du får redigera"
next
Då får jag
Feltyp:
Körningsfel i Microsoft VBScript (0x800A000D)
Inkompatibla typer: 'cint'
/Hemsidor/GlobalaForeningen/Forum/forhand.asp, line 74
if not isnull(rs("replyid")) then
arrKakID = split(request.Cookies("redigera") ,",")
for i = 0 to ubound (arrKakID)
if cint(arrKakID(i)) = cint(RS("ReplyID")) then
Response.Write Request.Cookies("redigera") & "Du får redigera"
exit for
end if
next
end if
------------------ essentitia preter non sans multiplicandum
Hur ser cookies("redigera") ut? Kan det vara något värde i den som inte går att konvertera?
Du kan testa om ett värde är numerisk med funktionen isNumeric
if not isnull(rs("replyid")) then
arrKakID = split(request.Cookies("redigera") ,",")
for i = 0 to ubound (arrKakID)
if isNumeric(arrKakID(i)) and isNumeric(RS("ReplyID")) then
if cint(arrKakID(i)) = cint(RS("ReplyID")) then
Response.Write Request.Cookies("redigera") & "Du får redigera"
exit for
end if
end if
next
end if
------------------ essentitia preter non sans multiplicandum