Shop OBEX P1 Docs P2 Docs Learn Events
SV: [basicstamps] RUN within GOSUB — Parallax Forums

SV: [basicstamps] RUN within GOSUB

ArchiverArchiver Posts: 46,084
edited 2004-01-16 14:08 in General Discussion
Greetings!

The stack is cleared when you use the RUN command.
Please note, you don't 'call' the other program slot with RUN, you stop
executing in the old slot and start executing in the new slot. There's
no way to 'return' to where you left off in the first slot.

Variables and scratchpad RAM, though, is unaffected, so can be used to
pass parameters and program state back and forth. (There are some good
docs about this on the Parallax site)

:-)
Trygve


Opprinnelig melding
Fra: dangerduckula [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=fmcIuwfnzD8sHYV1HRgvz71vkPL2Lox-mPqAUtg4s8zCC4WvIjXoylaxo1FwreoBjQVOyAcYeohJ74LtshxHlutU]countduckula@o...[/url
Sendt: 16. januar 2004 12:03
Til: basicstamps@yahoogroups.com
Emne: [noparse][[/noparse]basicstamps] RUN within GOSUB


Calling a subroutine saves the program counter to the stack, if I
call another program slot using the run command will I eventually run
into trouble or is the stack cleared everytime a new program slot is
run.
Sign In or Register to comment.