PDA

View Full Version : Floating point error


JHobbs
09-22-2002, 03:42 AM
Hi All,
The server is returning a floating point error whenever I send a CGI dynamically created integer to the function

Here's the stripped-down function:

function MapPt(MidX)
{
location.href="http://www.whatever.exe/DotZoom?CC=MidX";
}

Here's the problem:

If I sent this to the function

HREF="javascript:MapPt(4447)

the server handles the function ok

but if I replace the number 4447 with a dynamically generated integer, I get this error from the server:

Exception EConvertError
Message: MidX is not a valid floating point value

I'm not sure if I given you enough to go on. I wanted to just include relevant information.

Thanks

mordred
09-22-2002, 11:22 AM
I'm afraid we can't tell you why this server error happens, because this is no JavaScript issue. The CGI that receives the input as GET parameter seems to be picky about the format it gets these, and you can't say from a distance what happens insided a .exe file....

Though I suspect that you have your JS code not right, shouldn't it rather be

location.href = "http://www.whatever.exe/DotZoom?CC=" + MidX;

That way that passed parameter gets appended to the URL. Try alert() the URL before you reassign it to location href and try to see a pattern of cases, under which the server generates the error.