Skip to content

OPTION GOSUB


Enables support for Gosub and On Gosub.

Syntax

` Option Gosub

`

Description

Option Gosub enables support for Gosub and Return (from gosub).

Because Return could mean return-from-gosub or return-from-procedure, Option Gosub and Option Nogosub can be used to enable and disable Gosub support. When Gosub support is disabled, Return is then recognized as return-from-procedure.

Examples

start GeSHi

vb
'' Compile with the "-lang fblite" compiler switch

#lang "fblite"

'' turn on gosub support
Option GoSub

GoSub there
backagain:
    Print "backagain"
    End

there:
    Print "there"
    Return

end GeSHi

Dialect Differences

Differences from QB

  • New to FreeBASIC

See also

  • __FB_OPTION_GOSUB__
  • Option Nogosub
  • Gosub
  • Return (from Gosub)
  • Return (from procedure)

Back to DocToc

Translated from FreeBASIC official docs. Contact us for removal if infringed.
FreeBASIC is an open-source project, not affiliated with Microsoft