From: Duane Bozarth on
Athena wrote:
>
> Mike,
>
> What I want is to plot a pointcloud data in 3D. Different parts of
> the data is to have different colors. I should be able to rotate the
> plot by using mouse. For this I have to write a piece of code either in
> DirectX or OpenGL. Since I am not a professional programmer such as
> yourself, my solution was to find a nice dll (NTGraph3d)and plot for x,y
> and z sets (12 variables) using this dll. Do you know a VB code that
> would plot >50000 data points in less than 1s and capable of rotating
> the plot? I would be happy to use it right away.
>
> Otherwise I am stuck with this "overflow" error.
>
> Do you know how to find the origin of an overflow error? In my case
> not only it is intermitent, but it pops up from different parts of the
> program. This is what I want to find out from MVP's such as you.

If the overflow is in the VB code, it will pop up an error box w/ "error
6" in the IDE. At that point you should be able to see which is the
offending line (again in the IDE).

Have you tested the identical data sets on the two machines where you
get the overflow and don't to make sure it isn't just a data
difference? If you get differing results on the two machines, then
there obviously is a difference in the environment between the two.
Start looking for revision levels of runtime, other installed software,
etc.

I concur that it would be wise to try to eliminate the Variants as much
as possible. Having come from a background where it was necessary to
maintain some really old FORTRAN code, I'm not nearly as upset about the
argument lists altho it's not how I would code now, there is nothing
inherently wrong w/ the code other than style---that is, it doesn't
relate to the problem directly.
From: Athena on
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(a)comcast.net> wrote in message
news:uFoTCbq1FHA.3660(a)TK2MSFTNGP15.phx.gbl...
> 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
>
>
>
>
>
>
>


From: Athena on
Thank you,

I will certainlu look at your error handling routine.

Athena

"Someone" <nobody(a)cox.net> wrote in message
news:uyVMYNr1FHA.3816(a)TK2MSFTNGP14.phx.gbl...
> See my post here about how to add error handling to all routines that
> pinpoints the line number:
>
> http://groups.google.com/group/microsoft.public.vb.general.discussion/msg/da28c493c61c6b60
>
> Also, it looks like you typed your code instead of using Copy&Paste.
> Please post code fragments and also the Dim statement. How a variable
> appears in a Dim statement is very important.
>
> In this example:
>
> Dim Num1, Num2 As Double
>
> Num1 is a Variant, Num2 is a Double. In VB6 and prior, use the following
> syntax:
>
> Dim Num1 As Double, Num2 As Double
>
>
>
>
> "Athena" <girit(a)comcast.net> wrote in message
> news:uFoTCbq1FHA.3660(a)TK2MSFTNGP15.phx.gbl...
>> 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
>>
>>
>>
>>
>>
>>
>>
>
>