Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 03:00 15 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CM2: maximum number of user defined subroutines and functions

Author Message
bar1010
Senior Member

Joined: 10/08/2020
Location: United States
Posts: 197
Posted: 11:09pm 08 Oct 2020
Copy link to clipboard 
Print this post

Would it be possible to increase the maximum number of user defined subroutines and functions to a number considerably larger than 500?
Actually I do not have anywhere near that number at the moment, yet am receiving Error : Too many SUB and FUN.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3308
Posted: 11:27pm 08 Oct 2020
Copy link to clipboard 
Print this post

The error message is a little deceptive.  It should say "Too many nested SUB and FUN".

You are probably recursively calling a SUB or FUN and have reached the limit.  Due to the way that BASIC (and MMBasic works) recursion is limited and has some restrictions.  For example you will get into trouble if you recursively call a sub/fun from a FOR...NEXT loop within that sub/fun.

Geoff
Geoff Graham - http://geoffg.net
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025