On...GoSub Statement
Category | Flow Control Features |
Availability | VB:Yes, VBA:Yes, VBScript:No |
Purpose | Branches to one or more code sections based on an expression. |
Typical Syntax | On expression GoSub destinationlist |
See Also | Choose Function, GoSub Statement, GoTo Statement, IIf Function, On...GoTo Statement, Resume Statement, Select Case Statement |
Do not use the On...GoSub statement within your Visual Basic source code. Usage of this statement can result in subtle errors, maintenance difficulties, and debugging nightmares. Use a Select Case statement instead to redirect your procedure based on an expression value.
On...GoTo Statement
Category | Flow Control Features |
Availability | VB:Yes, VBA:Yes, VBScript:No |
Purpose | Branches to one or more code sections based ... |
Get Visual Basic® Style Guide, The now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.