Qbasicnews.com

Full Version: out of stack space
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
wow, its like, every time i start my program i get a new error.
Like, today i wake up in the morning and start the program and a "Out Of Stack Space" error came up.
I used the clear statement for double checking but it still came up.


:evil: :evil: DAMN BUGS!!!! :evil: :evil:
Ensure all GOSUBS have their RETURNS and you are not exiting a GOSUB with a GOTO
try to get the best from the modules tutos you'll grab here and there...

You probably have big subs that have a lot of local variables. Try to re-think you prog in an object-oriented mood, and don't hesitate to use TYPE if it helps.

Remember a pack of variables (arrays, types, etc...) cannot be more than 64kb, based on the following rules:

1 integer = 2 bytes = 1 number ranging from 0 to 64535
1 string, len=1 = 1 byte = 1 number ranging from 0 to 255
1 real = 4 bytes

etc...

You can "pack" integers on one byte provided they range from 0 to 255, and therefore combine 2 parameters ranging from 0 to 255 into one integer (2 bytes).

You can convert a real number such as .7657 into an integer by multiplying it by 64536...

The rational is endless....

But always remember it's a matter of 0 & 1's...
Humph! How many times will I post this?

http://qbasicnews.com/articles/articles.cgi?page=limits

Please read it carefully. Imp to note is usage of COMMON SHARED.

May be I will add this to my signature? Will it help?