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

Home › Array Functions › $Static

$Static

Metacommand to change the way arrays are allocated

Syntax

'$Static
Rem $Static

Description

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

Remarks

Dialect Differences

Differences from QB

  • When used inside comments it must be the first token

See also

Examples

' compile with -lang fblite or qb

#lang "fblite"

'$dynamic

Dim a(100)   '<<this array will be variable-length

'$static

Dim b(100)   '<<this array will be fixed-length

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