Re: Error from Hell: Overflow

Tech-Archive recommends: Fix windows errors by optimizing your registry



All those who reply for the "Error from Hell",

I found the source of error after almost 3 days of intense debugging by
chance. And you won't belive what was the source of error.

First of all let me remind you that the Error 6 "Overflow" was coming on
random places sometimes on VB's own Timer function, not on a particular
statment! Also this wasn't the most interesting thing that was happening:
When I place the mouse over where the program stopped at in debug mode, the
intellisense would say there is an overflow. Then I would move the mouse to
one side and come back on the same variable. This time I would get NO error
and the program would pass this line normally and but give me an overflow
error on some other variable such as Timer function further in the program!

So here is the culprit: My VB program uses a C based dll. This program
does a lot of matrix based calculations to provide me points on a 3D mesh.
It turns out some of these points were infinite! When I was checking the
contents of the x,y, and z variables the program returns I realized that one
of them was -1#.IND. Has anyone seen a number like this on VB? Now if you
divide this number by 10, you would get the same number, or if you multiply
it by1234 you still get -1#.IND. I checked Help, not a word of it. So
after this realization, the solution was simple, I trapped them in the
program generating these numbers and set them to zero. The problem was
resolved.

Thank you for all the answers.

My regards,

Athena



"Athena" <girit@xxxxxxxxxxx> wrote in message
news:uFoTCbq1FHA.3660@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> My VB6 (SP6) app produces an Overflow error and bombs. I use Win XP
> (Sp2).
>
> 1) Program has Option Explicit. So every variable is typed.
> 2) Program works fine on one computer, but not on another!
> 3) Error is intermittent.
> 4) Sometimes it overflows even on VB timer function.
>
> I am using a dll that was created from another program. In the calling
> statement, there are 13 output arguments (x1,y1,z1,...) defined as
> Variant. They are arrays with no priory knowledge of their size. And there
> are several input arguments (in1,in2...) typed as double.
>
> Dim b as variant
> Dim x1 as variant
> Dim y1 as variant
> ......
>
> call subroutine(13,
> b,x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4,in1,in2,in3,in4,...)
>
> These arrays used to plot a 3D graph:
>
> with Graph3D
>
> for i=1 to ubound(a1,1)
> PlotXYZ x1(i,1),y1(i,1),z1(i,1),0
> next
> for i=1 to ubound(a1,1)
> PlotXYZ x2(i,1),y2(i,1),z2(i,1),1
> next
> for i=1 to ubound(a1,1)
> PlotXYZ x3(i,1),y3(i,1),z3(i,1),2
> next
> for i=1 to ubound(a1,1)
> PlotXYZ x4(i,1),y4(i,1),z4(i,1),3
> next
> .autorange
>
> end with
>
> I believe the overflow is caused by somewhere in these for loops. If I
> remove the last two or three loops it goes away! What the hell is going
> on?
>
> Is there a way to detect/trap overflow? I run MS code advisor, it is
> useless. Any help greatly be appreciated. Please help.
>
> Cem
>
>
>
>
>
>
>


.



Relevant Pages

  • Re: Error from Hell: Overflow
    ... Dim statement is very important. ... Num1 is a Variant, Num2 is a Double. ... > I believe the overflow is caused by somewhere in these for loops. ...
    (microsoft.public.vb.general.discussion)
  • Re: Error from Hell: Overflow
    ... > Please post code fragments and also the Dim statement. ... >> Variant. ... >> I believe the overflow is caused by somewhere in these for loops. ...
    (microsoft.public.vb.general.discussion)
  • Re: Error from Hell: Overflow
    ... I will certainlu look at your error handling routine. ... > Please post code fragments and also the Dim statement. ... >> Variant. ... >> I believe the overflow is caused by somewhere in these for loops. ...
    (microsoft.public.vb.general.discussion)
  • Re: Error from Hell: Overflow
    ... > Dim b as variant ... > Dim x1 as variant ... > I believe the overflow is caused by somewhere in these for loops. ...
    (microsoft.public.vb.general.discussion)
  • Re: Error from Hell: Overflow
    ... > My VB6 app produces an Overflow error and bombs. ... > Dim b as variant ... > Dim x1 as variant ... I run MS code advisor, ...
    (microsoft.public.vb.general.discussion)