View Single Post
Old 02-04-2013, 09:05 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,248
Thanks: 59
Thanked 3,999 Times in 3,968 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
The error means that there is *NO* element 2 in the array.

That is, your SPLIT did *NOT* create at least 3 parts.

But your code makes NO SENSE anyway:
Code:
<%
For n = 0 to 3
    mystring = rs1("texts") 
    myword = strkeyword 
    myarray = Split(mystring, myword, 3, 1) 
Next
%>
The code does the SAME THING THREE TIMES!

WHY? NOTHING changes in the 3 iterations.

Maybe you should DEBUG???

Code:
<%
mystring = rs1("texts") 
Response.Write "DEBUG: mystring is ::" & mystring & "::<hr/>"
myword = strkeyword 
Response.Write "DEBUG: myword is ::" & myword & "::<hr/>"
myarray = Split(mystring, myword, 3, 1) 
Response.Write "DEBUG: UBound(myarray) is " & UBound(myarray) & "<hr/>"
%>
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote