Too many nested GOSUBS

Laura Brody laura at hvcomputer.com
Wed Dec 20 10:01:31 PST 2006


Quoting Don Coleman <dcoleman at dgcreact.com>:

> Merry Christmas to all:
>
> I have a posting routine which posts data from FILE A to FILE B based on a
> transmitted (posted)(YESNO) flag.  Data is received into FILE A from an
> alien application via a socket connection.  No problems here.  However, I
> have a *clerk process which posts the data from FILE A to FILE B based on
> the transmitted flag.  Once again, no problem here.  My problem is during
> the posting process one of four subroutines (GOSUBS) occurs based on the
> type of transaction.  With this one particular transaction code the system
> does not generally create a new record in FILE B but does update certain
> fields in FILE B.  When complete, the app. goes back (returns) to find the
> next record to be transmitted via the index flag.
>
> Occasionally this subroutine will error with a "too many nested gosubs"
> message and need to be restarted.  Within this primary gosub routine there
> are a maximum of 5 additional gosub routines that are condition dependent.
> Most of the transactions would not meet any of those conditions.  My
> documentation states there is a maximum of 16 nested gosub routines
> permitted (fP v5.0.13) (Windows 2000 server & clients).  My question is why
> do I occasionally get this error message?

  Correction: in v5.0 and later, gosubs could be nested up to
64 levels deep.

  With this in mind, it sounds like you have a missing "return"
someplace in your code. If you have a "goto" or "end" rather
than a "return", the gosub return stack fills up until you max
it out and generate the error.

> Could it be that the "internal counter" within fP is not being cleared when
> one record is finished (written) and the app. goes to get the next record to
> be posted?

   Not likely.

--
Laura Brody
+------------- Hudson Valley Computer Associates, Inc ----------+
| PO Box 859 120 Sixth Street    http://www.hvcomputer.com      |
| Verplanck, NY 10596-0859       Voice mail: (914) 739-5004     |
+------ PC repair locally, filePro programming globally --------+


More information about the Filepro-list mailing list