From QB64 Wiki
Revision as of 13:36, 20 April 2020 by Odin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

OPTION _EXPLICIT instructs the compiler to require variable declaration with DIM, REDIM or an equivalent statement.




  • With OPTION _EXPLICIT you can avoid typos by having QB64 immediately warn in the Status area of new variables used without previous declaration.
  • Enable OPTION _EXPLICIT temporarily even if a program source file doesn't contain the directive by specifying the -e switch when compiling via command line (qb64 -c file.bas -e).



Example: Avoiding simple typos with OPTION _EXPLICIT results shown in the QB64 IDE Status area.

OPTION _EXPLICIT DIM myVariable AS INTEGER myVariable = 5 PRINT myVariabe

QB64 IDE Status will show: Variable 'myVariabe' (SINGLE) not defined on line 7

See also

Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page