Run time error 7: "Stack underflow"
#5

Quote:
Originally Posted by Simon
View Post
Wow, didn't even see that Calgon. Here I was typing up a large post when it wasn't needed

However, something else I noticed in your code. It seems as if you're wasting an entire row of memory in your array. Array indexes start at 0 and end at size - 1. So you should really change your for loop to something like below else you're just wasting memory. It may only be a matter of bytes now, but you could possibly keep this "habit" and waste a significant amount of memory in larger projects.

From:
for (new idx = 1; idx<=totalpickups; idx++)

To:
for (new idx = 0; idx< totalpickups; idx++)
Heh

That actually reminds me of a minor flaw within my code, if you have a row missing an ID, (say for example you delete a pickup and there's a row ID missing, the array element is still there) make sure when you create new rows that you try to use IDs that were occupied with data but aren't any more.

A better example:
You create 60 pickup rows, you delete row ID 6, then row 6 is missing and the array element is still there.
Reply


Messages In This Thread
Run time error 7: "Stack underflow" - by Coicatak - 25.09.2009, 17:18
Re: Run time error 7: "Stack underflow" - by Logitech3334 - 05.09.2010, 07:25
Re: Run time error 7: "Stack underflow" - by Calgon - 05.09.2010, 07:32
Re: Run time error 7: "Stack underflow" - by Simon - 05.09.2010, 07:44
Re: Run time error 7: "Stack underflow" - by Calgon - 05.09.2010, 07:54

Forum Jump:


Users browsing this thread: 1 Guest(s)