Skip to content

Option Static

Paul Squires edited this page Sep 19, 2026 · 1 revision

Home › Array Functions › Option Static

Option Static

Reverts to default array declaration behavior

Syntax

Option Static

Description

Option Static is a statement that overrides the behavior of Option Dynamic, that is, arrays declared with constant subscript ranges are fixed-length. This remains in effect for the rest of the module in which Option Static is used, and can be overridden with Option Dynamic. It is equivalent to the '$Static metacommand.

Remarks

Dialect Differences

Differences from QB

  • New to FreeBASIC

See also

Examples

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

#lang "fblite"

Option Dynamic

Dim foo(100) As Integer            ' declares a variable-length array

Option Static

Dim bar(100) As Integer            ' declares a fixed-length array

Category: Array Functions
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