Skip to content

Fb Option Gosub

Paul Squires edited this page Oct 14, 2026 · 2 revisions

Home › Intrinsic Defines › FB_OPTION_GOSUB

FB_OPTION_GOSUB

Intrinsic define (macro value) set by the compiler

Syntax

__FB_OPTION_GOSUB__

Description

Indicates how GoSub and Return will be handled at compile time. If the option is set (-1) then GoSub is allowed and Return is recognized as return-from-gosub only. If the option is not set (0) then GoSub is not allowed and Return is recognized as return-from-procedure only.

This macro value can be changed at compile time. Option Gosub will set the option (enable gosub support) and Option Nogosub will clear the option (disable gosub support).

__FB_OPTION_GOSUB__ returns zero (0) if the option has not been set. Returns non-zero (-1) if the option has been set.

Remarks

Dialect Differences

  • Defaults to -1 in the -lang qb dialect and 0 in all other dialects.

Differences from QB

  • New to FreeBASIC

Examples

#if( __FB_OPTION_GOSUB__ <> 0 )

    '' turn off gosub support

    Option nogosub

#endif

Category: Intrinsic Defines
Kind: keyword


Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.

Clone this wiki locally