Shop OBEX P1 Docs P2 Docs Learn Events
Nested GOSUBs... — Parallax Forums

Nested GOSUBs...

ArchiverArchiver Posts: 46,084
edited 2002-08-15 04:44 in General Discussion
Hi,

Just wondering why there is a limit of 4 nested GOSUB's in the Stamp?

I've been working on some code, and have got most of the code that is
repeatedly called upon in Subroutines, to save on EEPROM space.

Example - I cut used EEPROM space down from 48% to 43% tonight, but on
running the program it went back to the start of the code after a button was
pressed (an indication that there are too many GOSUB's within GOSUB's).

I counted the number of jumps I had and it came to 5, so I ended up
repeating a small chunk of code in order to make it all work (and lost 1%
EEPROM space - 44%).

Still, I've saved 4% EEPROM space, but the limit of 4 nested GOSUB's is hard
to avoid sometimes... :-\

Also, an idea for future Stamp Editor releases:

How about the Editor automatically making comments a red colour?
Makes it easier to read the code then (bit like the sample codes on my web
site).

cheers,

Ben, Windy Wellington, New Zealand.

--
http://www.lennard.net.nz/
Ben Lennard, NCEE, Dip EE

Web Hosting and Electronics R&D

Hm: +64 4 972 7567
Mb: +64 21 536 627
87 Spencer Street
Crofton Downs
Wellington
New Zealand

"To the optimist, the glass is half full. To the pessimist, the glass is
half empty. To the engineer, the glass is twice as big as it needs to be."

No animals were harmed in the transmission of this email, although the
Dog next door is living on borrowed time, let me tell you! Those of you
with an overwhelming fear of the unknown will be gratified to learn that
there is no hidden message revealed by reading this warning backwards.
Sign In or Register to comment.