Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Runtime 6 - Overflow ?
#1
I was working on my inventory and when I try to login to my game
I get Runtime 6, Overflow, it highlights this:

[Image: overflowxv2.png]

Does anyone know what causes overflow?
I tried to figure out the answer, but couldn't find anything usefull.

EDIT: I tried making a new character and login.
Now I get runtime 9 - Subscript out of range.
Reply
#2
I'm guessing you're trying to set it as a number too high.

Hover your mouse over "invslot" and screenshot it, and also take a screenshot with your mouse hovering over "itemnum"
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#3
JUst add a small checK:

Code:
If  invslot < 0 or invslot > MAX_INV then exit sub
if itemnum < 0 or itemnum > MAX_ITEMS then exit sub
This will solve the error but if you get problems you should dig more into were it starts etc.
Reply
#4
If I were you, I'd only use checks like that during release, otherwise there wont be a nice yellow bar telling you where your source is fucked until you learn to follow packets and code trails.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#5
Lol, u guys kinda helped me understand a new part of VB6.

Although I'm pretty new to VB6, I have lots of experience in coding in Java, wich isn't lots of different from VB6.
Although I didn't realise that this Overflow error had to do anything with my inventory slots increasing my max slots, I made 32 of these while my max was set to 24.

Thank you both for helping me out.
Reply
#6
Now problem, but tbh most languages are alike in the way they are executed.

Once you know one, it's usually easier to learn another.

Glad to have helped ;D
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)