Too many nested gosubs

Richard Kreiss rkreiss at gccconsulting.net
Thu Nov 14 10:33:13 PST 2013


> -----Original Message-----
> From: Kenneth Brody [mailto:kenbrody at spamcop.net]
> Sent: Thursday, November 14, 2013 1:26 PM
> To: Richard Kreiss; filepro-list at lists.celestial.com
> Subject: Re: Too many nested gosubs
> 
> On 11/14/2013 1:05 PM, Richard Kreiss wrote:
> [...]
> > In many cases the folder with the pdf file may have well over 1000 pdf
> > files to be deleted.  The date check is the GOSUB routine which most
> > likely is where the problem lies.
> >
> > This problem will not exist after this initial run as it will become
> > part of a daily report run.
> >
> > However, I would like to know how many iterations of a gosub can be
> > run before this error occurs.
> 
> GOSUBs can be nested up to 64 deep.  However, why should the number of
> files make a difference here, since I would hope that your subroutines issue a
> RETURN when done?

It does until it reaches a date which is within 60 days of today and then there is a goto.

I modified the program to use a goto and put a label in the processing line.  That cleared up the problem.

However, a return was issued, the file deleted and then the next file was gotten by incrementing the array index and the process repeated.  I think that is what the program didn't like.  On the return from the system call there was a goto.  Maybe I should have put in a return here also.

Richard


> 
> --
> Kenneth Brody


More information about the Filepro-list mailing list