FreeBASIC Dialects

   FreeBASIC version 0.17b introduces a -lang command-line option, used to 
   change the language compatibility mode for different dialects of the 
   basic language.

      +------------+----------------------------------+
      |-lang option|description                       |
      |fb          |FreeBASIC compatibility (default) |
      |qb          |qbasic compatibility              |
      |deprecated  |previous fbc version compatibility|
      +------------+----------------------------------+

   The -lang option was needed to allow FB to support object-orientation 
   and other features in the future, without crippling the QuickBASIC 
   support or breaking compatibility with old FB sources, and without 
   making FB difficult to maintain with many different versions of very 
   similiar packages. The QuickBASIC support can continue to be improved, 
   if needed, without breaking the sources written specifically for FB.

   To compile old GW-BASIC or QuickBASIC/QBasic sources without too many 
   changes, use the -lang qb option on the command-line when running fbc. 
   This option will evolve into a better compatibility with 
   QuickBASIC/QBasic code.

   To compile FreeBASIC 0.16b or below sources, use the -lang deprecated 
   option. This option is maintained for compatibility and will not evolve 
   in the future, and it's likely to disappear when FreeBASIC reaches a 
   non-beta release.

   It is recommended to use -lang fb for new projects, as new features 
   (object classes, inheritance..) will be added exclusively to this 
   dialect.

-lang fb (the default mode)

   Not supported:

   1) implicit variable declaration
      * All variables must be explicitly declared, using Dim, ReDim, Var, 
        Const, Extern or Common.

   2) type suffixes (!, #, $, %, &)
      * They are only allowed for numeric literals, but it's recommended 
        to use Cast or the f (single), d (double), ll (longint), ul (
        uinteger), ull (ulongint) numeric literal suffixes to resolve 
        overloading.

   3) DefByte, DefUByte, DefShort, DefUShort, DefInt, DefUInt, DefLng, 
   Deflongint, Defulongint, DefSng, DefDbl, DefStr
      * An explicit type ("As T") is needed when declaring variables using 
        Dim, ReDim, Extern or Common. Variables declared using Var or Const 
        have their types inferred from an initialization value (an explicit 
        type is optional using Const).

   4) all parameters passed by reference by default
      * By default, all intrinsic scalar types - numeric and pointer types 
        - are passed by value (ByVal). Any other type - String or 
        user-defined type - is passed by reference (ByRef).
      * Use the -w pedantic command-line option to have parameters without 
        explicit ByVal or ByRef reported.

   5) OPTIONs of any kind (no context-sensitivity)
      * Instead of Option NoKeyword, use #undef.
      * Instead of Option Escape, use: !"some esc seq \n\r" (notice the '!
        ' char) and pass -w pedantic to check for possible escape 
        sequences.
      * Option Explicit isn't needed, see item 1.
      * Instead of Option Dynamic, declare variable-length arrays using 
        ReDim. Dim can also be used to declare variable-length arrays using 
        variable or no subscripts.
      * Instead of Option Base, use explicit lower-bound subscripts in 
        arrays declarations.
      * Instead of Option Private, use Private to declare procedures with 
        internal linkage.

   6) periods in symbol names 
      * Use namespaces instead.
    
   7) GoSub or Return (From Gosub)
      * Nested procedures may be allowed in future.

   8) On Gosub or On Goto
      * Use SELECT expr AS CONST for the latter.

   9) On Error or Resume
      * Most runtime and graphics library procedures now return an error 
        code, like:  IF OPEN( "text" FOR INPUT AS #1 ) <> 0 THEN error... 

   10) '$DYNAMIC, '$STATIC, '$INCLUDE meta-commands embedded in comments
      * See item 5 about Option Dynamic.
      * Use #include "filename" instead of '$include.

   11) Call or Let
      * Just remove them.

   12) numeric labels
      * No comment.

-lang deprecated
    
   Supported: Anything allowed in version 0.16b, but:

   1) GOSUB/RETURN and ON ... GOSUB (even at module-level)
      * so the GOSUB implementation could be thread-unsafe in the -lang qb 
        mode, allowing fast execution (-lang qb doesn't support 
        multi-threading, while -lang deprecated does).

   Not supported:

   1) Classes
      * Periods allowed in symbol names make it too difficult and/or 
        ambiguous.

   2) Operator overloading
      * Periods allowed in symbol names make it too difficult and/or 
        ambiguous.

   3) Constructors, destructors and methods in TYPEs.
      * Periods allowed in symbol names make it too difficult and/or 
        ambiguous.

-lang qb

   Supported: Everything not supported/allowed in the fb mode, plus..

   1) Call can be used with forward-referenced functions. (W.I.P.)

   2) Shared can be used inside functions. (W.I.P.)

   3) All variables, implicitly or explicitly declared, are always 
   allocated in the procedure scope, like in QuickBASIC.

   4) The Data statement won't look up symbols, every token is assumed to 
   be a literal string even without quotes, like in QuickBASIC.

   Not supported:

   1) Multi-threading
      * None of the threading procedures may be used.

   2) Classes and Namespaces

   3) Procedure and operator overloading

   4) Constructors, destructors and other member procedures in Type 
   definitions.

   5) Scope blocks

   6) Extern blocks.

   7) Variable initialization
      * All variables are moved to the procedure scope (like in QuickBASIC),
        making initializing local variables too difficult to support.

This file converted from:
   http://www.freebasic.net/wiki/wikka.php?wakka=CompilerDialects
