Board index » delphi » Stack overflow or débordement de pile

Stack overflow or débordement de pile

Hi, I'm working in Delphi 3 on a database project. At school, we got Delphi
version 4. On my computer, everything is ok, everything's going well. When I
go on the school computers, All the files (units and forms) are opening but
when I try to execute the program, it says : "Dbordement de pile" = stack
overflow I think. How could I get rid of this message? Why is that message
show itself? My teacher doesn't know how to fix the problem. We've went in
the compilator settings and the stack was kind of ok. Please help me!!
Thanks!

Alain

 

Re:Stack overflow or débordement de pile


A stack overflow usually reflects a loop. Too many recursive calls to a
function or procedure.

Robert

Quote
Alain Bordeleau wrote in message ...
>Hi, I'm working in Delphi 3 on a database project. At school, we got Delphi
>version 4. On my computer, everything is ok, everything's going well. When
I
>go on the school computers, All the files (units and forms) are opening but
>when I try to execute the program, it says : "Dbordement de pile" = stack
>overflow I think. How could I get rid of this message? Why is that message
>show itself? My teacher doesn't know how to fix the problem. We've went in
>the compilator settings and the stack was kind of ok. Please help me!!
>Thanks!

>Alain

Re:Stack overflow or débordement de pile


Quote
Alain Bordeleau wrote:

> Hi, I'm working in Delphi 3 on a database project. At school, we got Delphi
> version 4. On my computer, everything is ok, everything's going well. When I
> go on the school computers, All the files (units and forms) are opening but
> when I try to execute the program, it says : "Dbordement de pile" = stack
> overflow I think. How could I get rid of this message? Why is that message
> show itself? My teacher doesn't know how to fix the problem. We've went in
> the compilator settings and the stack was kind of ok. Please help me!!

"Stack overflow" means that a method is doing something that causes
itself to be called, recursively.  Sometimes this is unavoidable and the
recursive call must detect that it is being called recursively.  You can
do this by defining a boolean variable called "recursionLock," private
to the form-object.  Now in your method you can:

        if not recursionLock then
          try
            recursionLock := true;
            ...
          finally
            recursionLock := false;
          end;

Other Threads