Shop OBEX P1 Docs P2 Docs Learn Events
Quick Question: Does ''RETURN'' send the programme back to ''Main'' or...... — Parallax Forums

Quick Question: Does ''RETURN'' send the programme back to ''Main'' or......

ArchiverArchiver Posts: 46,084
edited 2003-02-17 20:41 in General Discussion
...and here is a tip to help you remember where you are at. On your return
statement, add a comment with the name of the subroutine -- ie:

Do_This:

'your subroutine code goes here

RETURN 'Do_This

Original Message

> It returns to the line following the GOSUB.
>
> Even though this is pretty obvious to those of us who have been
programming
> since the stone age, I decided to RTFM myself before spouting off. RETURN
> acts as a "goto start of program" if there is no outstanding GOSUB. I
> hadn't noticed that before. Could lead to some interesting bugs!

> Quick Question: Does 'RETURN' send the programme back to 'Main' or
> back to the place from which it was called. Thanks!!
Sign In or Register to comment.