Skip to content

OPTION DYNAMIC


Specifies variable-length array declarations

Syntax

` Option Dynamic

`

Description

Option Dynamic is a statement that specifies that any following array declarations are variable-length, whether they are declared with constant subscript ranges or not. This remains in effect for the rest of the module in which Option Dynamic is used, and can be overridden with Option Static. It is equivalent to the '$Dynamic metacommand.

Examples

start GeSHi

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

#lang "fblite"

Dim foo(99) As Integer      ' declares a fixed-length array

Option Dynamic

Dim bar(99) As Integer      ' declares a variable-length array
' ...
ReDim bar(199)              ' resize the array

end GeSHi

Dialect Differences

Differences from QB

  • New to FreeBASIC

See also

  • __FB_OPTION_DYNAMIC__
  • '$Dynamic
  • '$Static
  • Option Static
  • Dim
  • Redim

Back to DocToc

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