Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with splice method of Array object

Status
Not open for further replies.

Sashko

Programmer
May 27, 2002
2
UA
Hi,
I have the next script
<html>
<body>
<%
if(Request.Form(&quot;btnsubmit&quot;)!=&quot;press&quot;){
var arr1=new Array();
arr1[0]=&quot;9821&quot;;
arr1[1]=1;
arr1[2]=&quot;98211&quot;;
arr1[3]=121;
Session(&quot;somekey&quot;)=arr1;
}
else{
Response.Write(&quot;test:&quot;);
var arr2=Session(&quot;somekey&quot;);
arr2.splice(1,1);
Response.Write(arr2.toString());
}
%>
<form name=&quot;test&quot; method=&quot;post&quot; action=&quot;<%=Request.ServerVariables(&quot;SCRIPT_NAME&quot;)%>&quot;>
<input type=&quot;submit&quot; name=&quot;btnsubmit&quot; value=&quot;press&quot;>
</form>
</body>
<html>
When ASP trys top execute the string
arr2.splice(1,1);
the script falls down and returns the error like this&quot;(0x8000FFFF)Catastrophic failure&quot;
I just cannot understand what is the problem
May be it's a Microsoft bug or what?
 
i may be way off here but is session(&quot;somekey&quot;) definetely got a value? I see you are setting it inthe first half of your logic but presuming this hasnt been done before then the variable would be empty or may not contain an array type. Both of these situations would explain the error.

hope this helps

rob
 
One more interesting thing : I can access property &quot;length&quot; and operator [] of that array, but don't have an access to any method.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top