Groups > Superbase > Superbase 3 programming > Re: Maximum Procedure Depth Exceeded




Maximum Procedure Depth Exceeded

Maximum Procedure Depth Exceeded
Mon, 14 Jan 2008 20:44:55 -060
I am looking for help understanding Error 198 - Maximum Procedure Depth 
Exceeded.

It pops up in many different applications that I have written.  When it does 
pop up, all command buttons and features of the applications will continue 
to generate the same error again, with the only solution being to shut down 
Superbase.  This makes my applications unsuitable for distribution to 
others.

In one example:  Data entry through a form that includes simple commands 
being executed before entering a field and upon exiting a field will 
generate this error after many records (approximately 50) have been entered.

A function key is used to enter the field - ENTER fieldname.file,0
Upon exiting the field, the data entry tab sequence next passes through the 
following command - STORE FORM: END

The use of these two simple commands through a Form will generate this Error 
198 after many records have been entered.

I will receive the same error in other applications with a lot of code 
executed before entering or after exiting a field on a form by way of CALL() 
or GOTO to a SUB() or label in a program.  In one application I have been 
successful in trapping the error with ON ERROR GOTO.  In other applications 
no amount of error trapping will work, neither will Superbase.Error(198) = 0 
or Superbase.ErrorRequest(198) = 0 have any effect to stop the error from 
interrupting the code.

Superbase's explanation of the error message says that procedure depends on 
the amount of system resources available to you.  Is this memory?  I have 
512mb memory on my computer.  Is this buffers?  Superbase documentation 
recomends using a lot of buffers.  What exactly are these resources?

What exactly does calling a procedure recursively mean?

Any one that can help me me with this or offer any insight with this problem 
would be greatly appreciated!

Thanks,

Richard Brewster 

Post Reply
Re: Maximum Procedure Depth Exceeded
Mon, 14 Jan 2008 22:19:51 -060
First of all in an application STORE FORM: END is never used or at least 
I have never used it that way except when debugging.

The END command stops execution of the current program in memory. The 
program is still resident in memory. So if you use Process() or a WHILE 
loop with WAIT command, you will never get back to it. Clicking on a 
form object that will execute some kind of procedure will still execute 
but never gets back to the primary processing loop or state such as 
Process(). Actually Process() is in a WHILE loop also.

GOTO and GOSUB statements have long been abandoned since the end of 
version 2. We substitute them for CALL, SUB and FUNCTION procedures.

Generally the error crops up when we gave IF - END IF, WHILE - END 
WHILE, CASE - END CASE, SUB and FUNCTION procedures that do not exit 
properly and then through the code logic reenters the above procedures 
or loops. If this happens too often, eventually you run out of memory 
resources and the error is generated.

EXAMPLE of recursive:

SUB Procedure1()
	CALL Procedure2()
END SUB

SUB Procedure2()
	CALL Procedure1()
END SUB

This is only one example using procedures


Richard Brewster wrote:
> I am looking for help understanding Error 198 - Maximum Procedure Depth 
> Exceeded.
> 
> It pops up in many different applications that I have written.  When it
does 
> pop up, all command buttons and features of the applications will continue

> to generate the same error again, with the only solution being to shut down

> Superbase.  This makes my applications unsuitable for distribution to 
> others.
> 
> In one example:  Data entry through a form that includes simple commands 
> being executed before entering a field and upon exiting a field will 
> generate this error after many records (approximately 50) have been
entered.
> 
> A function key is used to enter the field - ENTER fieldname.file,0
> Upon exiting the field, the data entry tab sequence next passes through the

> following command - STORE FORM: END
> 
> The use of these two simple commands through a Form will generate this
Error 
> 198 after many records have been entered.
> 
> I will receive the same error in other applications with a lot of code 
> executed before entering or after exiting a field on a form by way of
CALL() 
> or GOTO to a SUB() or label in a program.  In one application I have been 
> successful in trapping the error with ON ERROR GOTO.  In other applications

> no amount of error trapping will work, neither will Superbase.Error(198) =
0 
> or Superbase.ErrorRequest(198) = 0 have any effect to stop the error from 
> interrupting the code.
> 
> Superbase's explanation of the error message says that procedure depends on

> the amount of system resources available to you.  Is this memory?  I have 
> 512mb memory on my computer.  Is this buffers?  Superbase documentation 
> recomends using a lot of buffers.  What exactly are these resources?
> 
> What exactly does calling a procedure recursively mean?
> 
> Any one that can help me me with this or offer any insight with this
problem 
> would be greatly appreciated!
> 
> Thanks,
> 
> Richard Brewster 
> 
Post Reply
about | contact