Re: The UC - Windowless or Not

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Thu, 10 Sep 2009 15:54:08 -0700, "Karl E. Peterson"
<karl@xxxxxxxxxx> wrote:

Webbiz wrote:
I downloaded, unzipped and then tried to run this example.

It gives a Run-Time Error 11 "Division by zero" error and breaks at a
Me.Refresh line in the UC.

That's just weird! I just downloaded what was there, double-clicked the VBP,
punched F5, and it ran just fine. No problem opening the form, either.

Because it breaks there, I haven't a clue what this error is about. So
I'm not able to run the code to see what it is suppose to do.

Any ideas?

Did you see the yellow bar? That means you can just press F8 and step into the
code, to see where the problem is occuring. I think the last time I really looked
at that code was over a decade ago. Hard to see how that error could pop.


Karl,

Here is what the little yellow bar led me to:

Private Function ReadProperties() As Boolean
Dim obj As PolyButton
If m_Parent Then
Call CopyMem(obj, m_Parent, 4)
m_Sides = obj.Sides
m_Offset = obj.Offset
m_Width = obj.ScaleWidth
m_Height = obj.ScaleHeight
Call CopyMem(obj, 0&, 4)
ReadProperties = True
End If
End Function


The error is caused by obj.Sides equal to zero. This is because it
will later be used to divide into another value and thus the Divide by
Zero error.

Strangely, this error pops up simply by wanting to look at the
PolyTest form itself without even running the program in the IDE. If
you watched the video, you'll see what I mean.

Is it normal for this ReadProperties function to run whenever you
simply click on the View Form button in the IDE, because that is
what's apparently happening.

;-0

Webbiz
.



Relevant Pages

  • Re: DataType Conversion Speed
    ... Then divide by zero to conver to percent. ... > - if either field contains a value, that's the discount, ... > Then divide by zero to conver to percent. ...
    (microsoft.public.access.modulesdaovba)
  • Re: fft2 and ifft2 outputs
    ... Dave Robinson ... ./ is this element by element divide? ... whereas correlation requires the conjugation of the second vector. ... The reason that you are getting a divide by zero error is because you ...
    (comp.soft-sys.matlab)
  • Re: DataType Conversion Speed
    ... > Then divide by zero to conver to percent. ... >> - if either field contains a value, that's the discount, ... >> Then divide by zero to conver to percent. ...
    (microsoft.public.access.modulesdaovba)
  • Re: How many mathematicians ...
    ... be divided by 7 before multiplying by 6. ... Who is trying to divide h by 7? ... No division by zero. ... gets to zero even if Bonehead wishes it so. ...
    (sci.physics.relativity)
  • RE: #Num! division with IIf statements
    ... Actually, as written, you can very possibly get a divide by zero. ... In reality it's not divided by zero, these are nulls divided by nulls. ... particular date-range that's where I get the #Num! ...
    (microsoft.public.access.reports)