the only reason a indexOf would through an overfloaw error, would be that
converted to an int. most likely you are passing a bad value.
>
> Hi,
>
> I get a strange error in JScript aspx pages. When I call the String
> function .indexOf I sometimes get the error 'Overflow or underflow in
> the arithmetic operation'. I tried solving this error by using a
> dedicated function:
>
> function ccIndexOf(aStr, aSrch, aPos, aCounter)
> {
> var startPos = aPos ? aPos : 0;
> var counter = aCounter ? aCounter : 10;
> try
> {
> return aStr.indexOf(aSrch, startPos);
> }
> catch (excp)
> {
> if (counter > 0)
> {
> counter = counter-1;
> if (counter > 0)
> return ccIndexOf(aStr, aSrch, startPos, counter);
> }
> }
> return -1;
> }
>
> This seemed to workaround the problem. Unfortunately I now get the same
> error in what seems to be the integer comparison or parseInt function:
> [ERROR MESSAGE LISTING]
>
> Overflow or underflow in the arithmetic operation.
> Description: An unhandled exception occurred during the execution of
> the current web request. Please review the stack trace for more
> information about the error and where it originated in the code.
>
> Exception Details: System.ArithmeticException: Overflow or underflow in
> the arithmetic operation.
>
> Source Error:
>
>
> Line 5: <!--#include file="include\check.inc" -->
> Line 6: <%
> Line 7: var iSearchScreen =
> Request.QueryString("iSearchScreen") ?
> parseInt(Request.QueryString("iSearchScreen"), 10) :
> (Session("iSearchScreen").Count > 0 ?
> parseInt(Session("iSearchScreen"), 10) : 1);
> Line 8: var bFromToc = Request.QueryString("bFromToc") ?
> Request.QueryString("bFromToc"):"";
> Line 9: var sFirstHit = Session("iFirstHit");
>
>
>
> Source File: D:\Inetpub\wwwroot\rechtsorde.net\iframedemo.aspx Line:
> 7
>
> Stack Trace:
>
>
> [ArithmeticException: Overflow or underflow in the arithmetic
> operation.]
> Microsoft.JScript.Relational.JScriptCompare2(Object v1, Object v2,
> IConvertible ic1, IConvertible ic2, TypeCode t1, TypeCode t2) +1895
> Microsoft.JScript.Relational.EvaluateRelational(Object v1, Object
> v2) +737
> ASP.iframedemo_aspx.__Render__control1(HtmlTextWriter __output,
> Control parameterContainer) in
> D:\Inetpub\wwwroot\rechtsorde.net\iframedemo.aspx:7
> System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +27
> System.Web.UI.Control.Render(HtmlTextWriter writer) +7
> System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
> System.Web.UI.Page.ProcessRequestMain() +1926
>
> --------------------------------------------------------------------------------
>
> Version Information: Microsoft .NET Framework Version:1.1.4322.2300;
> ASP.NET Version:1.1.4322.2300
>
> [ERROR MESSAGE LISTING END]
>
> Does anyone know what causes this problem, and how I can either solve
> or work-around it?
>
> Thanks in advance,
> Greetings,
> Casper
>
>
> --
> sevilsivle
> ------------------------------------------------------------------------
> sevilsivle's Profile:
http://www.hightechtalks.com/m701 > View this thread:
http://www.hightechtalks.com/t2328741 >