Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stack exceeded

Status
Not open for further replies.

JGoudie

Programmer
Jun 17, 2002
16
0
0
CA
when i tried to declare a two dimensional array like this:

integer data[5000][7]

it said that it exceeded the stack or whatever when i tried to compile it. I was reading inthe help file and it mentioned something about only having 64k of stack or so. is there a way to increase this so that i can build large multi-dimensional arrays and stuff?
 
I am also running into this problem.

The Symantec run-time stack increase did not help

What all affects the "Stack Overflow Error" could it be that a large include file might be helping to cause this error? If so I could trim my all purpose include file down.

Any ideas? Thanks in advance. D.T.
 
I wouldn't think that an include file would affect the stack size (I would think the size is directly related to the number and size of variables declared, as well as any procedure calls/jumps), but it's worth a shot to try reducing the size of the include file. If that doesn't work, you can post your script and I can see if I notice anything else that might be causing the problem.


aspect@aspectscripting.com
 
From a little testing I found that there is a limit of about 255 string variables or 16,382 integer or long variables or 8192 float variables. It also appears that this is on a per procedure basis. Although I did have a stack overflow when I added a procedure call with no declared variables in the procedure from a 'main' with an array of 8192 floats, I did not get the overflow from a 'main' with 16,382 integers with calls to 80 procedures with no declared variables in them. (these equate to about 65K-bytes : 65,025 - strings, 65,528 - ints / longs, 65536 - floats)
Not exactly sure how the stack is configured but it appears the number of string variables used is the primary limiting factor.
 
Each procedure can access 64K of variables (integer and long require 4 bytes, float 4 bytes, string 256 bytes). If you need more than that, you can declare the variables as a global which does not have any size restrictions that I am aware of.


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top