Skip to content

Fb Option Byval

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

Home › Intrinsic Defines › FB_OPTION_BYVAL

FB_OPTION_BYVAL

Intrinsic define (macro value) set by the compiler

Syntax

__FB_OPTION_BYVAL__

Description

Indicates if parameters to a Function or Sub are passed by reference as with ByRef, or by value as with ByVal by default when the by value / by reference specifier is not explicitly stated.

__FB_OPTION_BYVAL__ is set to non-zero (-1) if by default parameters are passed value, and zero (0) if by default parameters are passed by reference.

The default for passing parameters by reference or by value is determined by the -lang command line option used during compilation or usage of Option ByVal in the source file.

Remarks

Differences from QB

  • New to FreeBASIC

See also

Examples

#if( __FB_OPTION_BYVAL__ <> 0 )

  #error Option ByVal must Not be used With This source

#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