2009. december 30., szerda

Stack Overflow error


Problem/Question/Abstract:

I was filling a Tree view from a huge number of hierarchical records. Inorder to keep them in hierarchy, I used
a recursive function. But after filling about 90%, a "Stack overflow" error occurred. How can I complete the operation.

Answer:

In Delphi, we can use the directive MAXSTACKSIZE to alter the Stack size.  Setting it to a large value causes more memory to be allocated in the stack

Eg:

{Include the following statement in your program}
{$MAXSTACKSIZE 999999}

Nincsenek megjegyzések:

Megjegyzés küldése