{{fbdoc item="title" value="OPTION DYNAMIC"}}----
Specifies variable-length array declarations

{{fbdoc item="syntax"}}##
	**Option Dynamic**
##
{{fbdoc item="desc"}}
	##**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 ##[[KeyPgOptionstatic|Option Static]]##.  It is equivalent to the ##[[KeyPgMetaDynamic|'$Dynamic]]## metacommand.

{{fbdoc item="ex"}}
{{fbdoc item="filename" value="examples/manual/switches/option-dynamic.bas"}}%%(freebasic)
'' 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
%%
{{fbdoc item="lang"}}
	- Only available in the //[[CompilerOptlang|-lang fblite]]// and //[[CompilerOptlang|-lang qb]]// dialects.

{{fbdoc item="diff"}}
	- New to ""FreeBASIC""

{{fbdoc item="see"}}
	- ##[[KeyPgDdfboptiondynamic|__FB_OPTION_DYNAMIC__]]##
	- ##[[KeyPgMetaDynamic|'$Dynamic]]##
	- ##[[KeyPgMetaDynamic|'$Static]]##
	- ##[[KeyPgOptionstatic|Option Static]]##
	- ##[[KeyPgDim|Dim]]##
	- ##[[KeyPgRedim|Redim]]##

{{fbdoc item="back" value="CatPgArray|Array Functions"}}{{fbdoc item="back" value="CatPgCompilerSwitches|Compiler Switches"}}{{fbdoc item="back" value="CatPgPreProcess|Preprocessor"}}