Return Statement

Syntax

GoSub label
...
label

Return


label

Use: Required

A subroutine label within a procedure.

Description

Branches back to a calling GoSub statement after executing a subroutine within a procedure.

Rules at a Glance

  • A subroutine can include an number of Return statements.

  • Return branches back to the statement immediately following the last executed GoSub statement in the current subroutine.

  • A GoSub statement and the subroutine it calls must reside within the same procedure.

Programming Tips and Gotchas

The Return statement is only included in this book for completeness, should you have to maintain legacy code; otherwise, you shouldn't be writing new code using the GoSub...Return statements, since it tends to create "spaghetti" code that is very difficult to read and to maintain. Code should be rewritten using separate procedures.

See Also

GoSub Statement
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.255.139