Revision [13339]

This is an old revision of KeyPgGosub made by JeffMarshall on 2008-05-08 07:43:25.



Control flow statement to use a section of code and return.

Gosub label

Execution jumps to a subroutine marked by a line label. Always use KeyPgReturn Return to exit a Gosub, execution will continue on next statement after Gosub.

The line label where Gosub jumps must be in the same main/function/sub block as Gosub. All the variables in the subroutine are shared with the block, no arguments can be used. For this reason Gosub is considered bad programming practice as it can generate unreadable and untraceable code. It is better to use KeyPgSub Sub or KeyPgFunction Function instead.

'' Compile with -lang qb
GoSub message

Print "Welcome!"

Dialect Differences:
Differences from QB:
See also:
Back to Control Flow
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki phatcode