Board index » delphi » Stack-Management

Stack-Management

Hi,

I need urgent help for a kind of curious problem. I use the TurboPascal 6.0
compiler. I have written a program and everything works fine, if it runs
under Win95. But when I try to run it under MS-Dos I'll get a runtime-error
202. (The stack-limit was set to 65520).

Does anybody know the reason for this behaviour? And how can I fix this
error? I think can't extend the limit of the stack, can I? So what I'll hav
to do is to save the current stack, clear it up, execute some routines and
restore it afterwards. Can anyone tell me how this could be done?
Is there an easier way to solve this problem (maybe using another compiler)
?

Thanks for any help.

Ingo

 

Re:Stack-Management


Quote
Ingo Gregor wrote in message <35b7537...@rainbow.hrz.uni-siegen.de>...
>Hi,

>I need urgent help for a kind of curious problem. I use the
TurboPascal 6.0
>compiler. I have written a program and everything works fine, if it
runs
>under Win95. But when I try to run it under MS-Dos I'll get a
runtime-error
>202. (The stack-limit was set to 65520).

That's a LOT of stack! And little information.

Could the program be doing something different under the different
OSes? For example, does some procedure erroneously call itself
recursively if (Lo(DosVersion) < 7) ?

I have noticed that sometimes a small loop will run a little faster
under DOS than Win95, presumably because of the OS doing something in
the background. Could your problem be timing-dependent, calling itself
recursively until the timer tick counter changes?

Use the de{*word*81} (TD or the integrated one in the IDE) to find what
the program is doing to use up all that stack. Then, if it's really
doing what it is supposed to, try finding a different way of doing it.
e.g. Have you got large arrays as local variables? Try putting them on
the heap instead. Too much recursion? Try finding an iterative
algorithm.

Good luck

FP

Other Threads