Results 1 to 3 of 3

Thread: Runtime Error 6: Overflow????

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    Great White North, ey?
    Posts
    202

    Unhappy Runtime Error 6: Overflow????

    Why do I get that error on this piece of code:

    If Bullet2(bu2).x + 30 >= StarX And Bullet2(bu2).x <= StarX + 30 And Bullet2(bu2).y + 30 >= StarY And Bullet2(bu2).y <= StarY + 30 Then HitStar2

    All this code does is check for collision between a bullet and a Star shape thing I have. The error doesn't come until about 40 seconds into runtime. Please help!

  2. #2
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724
    MSDN:

    Overflow (Error 6)


    An overflow results when you try to make an assignment that exceeds the limitations of the target of the assignment. This error has the following causes and solutions:

    The result of an assignment, calculation, ordata type conversion is too large to be represented within the range of values allowed for that type ofvariable.
    Assign the value to a variable of a type that can hold a larger range of values.

    An assignment to aproperty exceeds the maximum value the property can accept.
    Make sure your assignment fits the range for the property to which it is made.

    You attempt to use a number in a calculation, and that number is coerced into an integer, but the result is larger than an integer. For example:
    Dim x As Long
    x = 2000 * 365 ' Error: Overflow
    To work around this situation, type the number, like this:

    Dim x As Long
    x = CLng(2000) * 365
    For additional information, select the item in question and press F1.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    Great White North, ey?
    Posts
    202
    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width