Revision history for CompilerDialects


Revision [21602]

Last edited on 2016-10-25 14:55:41 by fxm [in -lang fb, On...Gosub is not supported, but On...Goto is allowed]
Additions:
""8"") ##[[KeyPgOngosub|On Gosub]]##
- Use ##[[KeyPgSelectcase|Select Case As Const integer_expression]]## instead.
Deletions:
""8"") ##[[KeyPgOngosub|On Gosub]]## or ##[[KeyPgOngoto|On Goto]]##
- Use ##[[KeyPgSelectcase|Select Case As Const]] //expr//## for the latter.


Revision [20750]

Edited on 2016-03-12 10:45:37 by fxm [Formatting]

No Differences

Revision [19900]

Edited on 2016-02-10 15:45:10 by DkLwikki [Update link format]
Additions:
""FreeBASIC"" version 0.17b introduces a //[[CompilerOptlang|-lang]]// command-line option, used to change the language compatibility mode for different dialects of the basic language.
Starting with version 0.18.3b the //[[CompilerOptlang|-lang qb]]// dialect has been further restricted to only allow what would have been allowed in [[QuickBASIC|QuickBASIC]].
In version 0.18.4b the //[[CompilerOptlang|-lang fblite]]// dialect was added, intended to replace ##-lang deprecated## in future.
In version 0.20.0b the ##[[KeyPgPplang|#lang]]## directive and ##[[KeyPgMetaLang|$lang]]## metacommand were added to specify a dialect from source.
The //[[CompilerOptlang|-lang]]// option was needed to allow ""FreeBASIC"" to support object-orientation and other features in the future, without crippling the ""QuickBASIC"" support or breaking compatibility with old ""FreeBASIC"" sources, and without making ""FreeBASIC"" difficult to maintain with many different versions of very similar packages. The ""QuickBASIC"" support can continue to be improved, if needed, without breaking the sources written specifically for ""FreeBASIC"".
To compile old GW-BASIC or ""QuickBASIC/QBasic"" sources without too many changes, use the //[[CompilerOptlang|-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"" sources from 0.16b, use the //[[CompilerOptlang|-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.
For programmers who want to access some of ""FreeBASIC""'s newer features, but want to retain a more QBASIC-friendly programming style, use the //[[CompilerOptlang|-lang fblite]]// option. This dialect will not undergo significant changes in the future, but will continue to be maintained and supported.
It is recommended to use //[[CompilerOptlang|-lang fb]]// for new projects, as new features (object classes, inheritance..) will be added exclusively to this dialect.
- All variables must be explicitly declared, using ##[[KeyPgDim|Dim]]##, ##[[KeyPgRedim|Redim]]##, ##[[KeyPgVar|Var]]##, ##[[KeyPgConst|Const]]##, ##[[KeyPgExtern|Extern]]## or ##[[KeyPgCommon|Common]]##.
- They are only allowed for numeric literals, but it's recommended to use ##[[KeyPgCast|Cast]]## or the ##f## (##single##), ##d## (##double##), ##ll## (##longint##), ##ul## (##ulong##), ##ull## (##ulongint##) numeric literal suffixes to resolve overloading.
""3"") ##[[KeyPgDefbyte|Defbyte]]##, ##[[KeyPgDefubyte|Defubyte]]##, ##[[KeyPgDefshort|Defshort]]##, ##[[KeyPgDefushort|Defushort]]##, ##[[KeyPgDefint|Defint]]##, ##[[KeyPgDefuint|Defuint]]##, ##[[KeyPgDeflng|Deflng]]##, ##[[KeyPgDeflongint|Deflongint]]##, ##[[KeyPgDefulongint|Defulongint]]##, ##[[KeyPgDefsng|Defsng]]##, ##[[KeyPgDefdbl|Defdbl]]##, ##[[KeyPgDefstr|Defstr]]##
- An explicit type ("##As //T//##") is needed when declaring variables using ##[[KeyPgDim|Dim]]##, ##[[KeyPgRedim|Redim]]##, ##[[KeyPgExtern|Extern]]## or ##[[KeyPgCommon|Common]]##. Variables declared using ##[[KeyPgVar|Var]]## or ##[[KeyPgConst|Const]]## have their types inferred from an initialization value (an explicit type is optional using ##[[KeyPgConst|Const]]##).
- By default, all intrinsic scalar types - numeric and pointer types - are passed by value (##[[KeyPgByval|Byval]]##). Any other type - ##[[KeyPgString|String]]## or user-defined type - is passed by reference (##[[KeyPgByref|Byref]]##).
- Use the ##-w pedantic## command-line option to have parameters without explicit ##[[KeyPgByval|Byval]]## or ##[[KeyPgByref|Byref]]## reported.
- Instead of ##[[KeyPgOptionnokeyword|Option Nokeyword]]##, use ###undef##.
- Instead of ##[[KeyPgOptionescape|Option Escape]]##, use: ##!"some esc seq \n\r"## (notice the '##!##' char) and pass ##-w pedantic## to check for possible escape sequences.
- ##[[KeyPgOptionexplicit|Option Explicit]]## isn't needed, see item 1.
- Instead of ##[[KeyPgOptiondynamic|Option Dynamic]]##, declare variable-length arrays using ##[[KeyPgRedim|Redim]]##. ##[[KeyPgDim|Dim]]## can also be used to declare variable-length arrays using variable or no subscripts.
- Instead of ##[[KeyPgOptionbase|Option Base]]##, use explicit lower-bound subscripts in arrays declarations.
- Instead of ##[[KeyPgOptionprivate|Option Private]]##, use ##[[KeyPgPrivate|Private]]## to declare procedures with internal linkage.
- Instead of ##[[KeyPgOptiongosub|Option Gosub]]## and ##[[KeyPgOptionnogosub|Option Nogosub]]##, use procedures with ##[[KeyPgSub|Sub]]## or ##[[KeyPgFunction|Function]]##.
""7"") ##[[KeyPgGosub|Gosub]]## or ##[[KeyPgReturn|Return (from Gosub)]]##
""8"") ##[[KeyPgOngosub|On Gosub]]## or ##[[KeyPgOngoto|On Goto]]##
- Use ##[[KeyPgSelectcase|Select Case As Const]] //expr//## for the latter.
""9"") ##[[KeyPgResume|Resume]]##
- See item 5 about ##[[KeyPgOptiondynamic|Option Dynamic]]##.
""11"") ##[[KeyPgCall|Call]]## or ##[[KeyPgLet|Let]]##
- Named labels can be used instead, e.g. ##label_name:## / ##[[KeyPgGoto|Goto]] label_name##.
**Supported:** //Anything allowed in the //[[CompilerOptlang|-lang deprecated]]// dialect, plus..//
- Use ##[[KeyPgOptiongosub|Option Gosub]]## to enable. This will disable ##RETURN## from exiting a procedure, due to ambiguity.
""1"") ##[[KeyPgScope|Scope]]## blocks
- All variables are given procedure scope. Explicit ##[[KeyPgScope|Scope]]## blocks may be added later.
**Supported:** //Everything not supported/allowed in the //[[CompilerOptlang|-lang fb]]// dialect, plus..//
""1"") ##[[KeyPgCall|Call]]## can be used with forward-referenced functions.
""2"") ##[[KeyPgShared|Shared]]## can be used inside functions. (W.I.P.)
""4"") The ##[[KeyPgData|Data]]## statement won't look up symbols, every token is assumed to be a literal string even without quotes, like in ""QuickBASIC"".
- None of the ##[[CatPgThreading|threading]]## procedures may be used.
""4"") Constructors, destructors and other member procedures in ##[[KeyPgType|Type]]## definitions.
""5"") ##[[KeyPgScope|Scope]]## blocks
""6"") ##[[KeyPgExternBlock|Extern]]## blocks
Deletions:
""FreeBASIC"" version 0.17b introduces a //[[CompilerOptlang -lang]]// command-line option, used to change the language compatibility mode for different dialects of the basic language.
Starting with version 0.18.3b the //[[CompilerOptlang -lang qb]]// dialect has been further restricted to only allow what would have been allowed in [[QuickBASIC QuickBASIC]].
In version 0.18.4b the //[[CompilerOptlang -lang fblite]]// dialect was added, intended to replace ##-lang deprecated## in future.
In version 0.20.0b the ##[[KeyPgPplang #lang]]## directive and ##[[KeyPgMetaLang $lang]]## metacommand were added to specify a dialect from source.
The //[[CompilerOptlang -lang]]// option was needed to allow ""FreeBASIC"" to support object-orientation and other features in the future, without crippling the ""QuickBASIC"" support or breaking compatibility with old ""FreeBASIC"" sources, and without making ""FreeBASIC"" difficult to maintain with many different versions of very similar packages. The ""QuickBASIC"" support can continue to be improved, if needed, without breaking the sources written specifically for ""FreeBASIC"".
To compile old GW-BASIC or ""QuickBASIC/QBasic"" sources without too many changes, use the //[[CompilerOptlang -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"" sources from 0.16b, use the //[[CompilerOptlang -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.
For programmers who want to access some of ""FreeBASIC""'s newer features, but want to retain a more QBASIC-friendly programming style, use the //[[CompilerOptlang -lang fblite]]// option. This dialect will not undergo significant changes in the future, but will continue to be maintained and supported.
It is recommended to use //[[CompilerOptlang -lang fb]]// for new projects, as new features (object classes, inheritance..) will be added exclusively to this dialect.
- All variables must be explicitly declared, using ##[[KeyPgDim Dim]]##, ##[[KeyPgRedim Redim]]##, ##[[KeyPgVar Var]]##, ##[[KeyPgConst Const]]##, ##[[KeyPgExtern Extern]]## or ##[[KeyPgCommon Common]]##.
- They are only allowed for numeric literals, but it's recommended to use ##[[KeyPgCast Cast]]## or the ##f## (##single##), ##d## (##double##), ##ll## (##longint##), ##ul## (##ulong##), ##ull## (##ulongint##) numeric literal suffixes to resolve overloading.
""3"") ##[[KeyPgDefbyte Defbyte]]##, ##[[KeyPgDefubyte Defubyte]]##, ##[[KeyPgDefshort Defshort]]##, ##[[KeyPgDefushort Defushort]]##, ##[[KeyPgDefint Defint]]##, ##[[KeyPgDefuint Defuint]]##, ##[[KeyPgDeflng Deflng]]##, ##[[KeyPgDeflongint Deflongint]]##, ##[[KeyPgDefulongint Defulongint]]##, ##[[KeyPgDefsng Defsng]]##, ##[[KeyPgDefdbl Defdbl]]##, ##[[KeyPgDefstr Defstr]]##
- An explicit type ("##As //T//##") is needed when declaring variables using ##[[KeyPgDim Dim]]##, ##[[KeyPgRedim Redim]]##, ##[[KeyPgExtern Extern]]## or ##[[KeyPgCommon Common]]##. Variables declared using ##[[KeyPgVar Var]]## or ##[[KeyPgConst Const]]## have their types inferred from an initialization value (an explicit type is optional using ##[[KeyPgConst Const]]##).
- By default, all intrinsic scalar types - numeric and pointer types - are passed by value (##[[KeyPgByval Byval]]##). Any other type - ##[[KeyPgString String]]## or user-defined type - is passed by reference (##[[KeyPgByref Byref]]##).
- Use the ##-w pedantic## command-line option to have parameters without explicit ##[[KeyPgByval Byval]]## or ##[[KeyPgByref Byref]]## reported.
- Instead of ##[[KeyPgOptionnokeyword Option Nokeyword]]##, use ###undef##.
- Instead of ##[[KeyPgOptionescape Option Escape]]##, use: ##!"some esc seq \n\r"## (notice the '##!##' char) and pass ##-w pedantic## to check for possible escape sequences.
- ##[[KeyPgOptionexplicit Option Explicit]]## isn't needed, see item 1.
- Instead of ##[[KeyPgOptiondynamic Option Dynamic]]##, declare variable-length arrays using ##[[KeyPgRedim Redim]]##. ##[[KeyPgDim Dim]]## can also be used to declare variable-length arrays using variable or no subscripts.
- Instead of ##[[KeyPgOptionbase Option Base]]##, use explicit lower-bound subscripts in arrays declarations.
- Instead of ##[[KeyPgOptionprivate Option Private]]##, use ##[[KeyPgPrivate Private]]## to declare procedures with internal linkage.
- Instead of ##[[KeyPgOptiongosub Option Gosub]]## and ##[[KeyPgOptionnogosub Option Nogosub]]##, use procedures with ##[[KeyPgSub Sub]]## or ##[[KeyPgFunction Function]]##.
""7"") ##[[KeyPgGosub Gosub]]## or ##[[KeyPgReturn Return (from Gosub)]]##
""8"") ##[[KeyPgOngosub On Gosub]]## or ##[[KeyPgOngoto On Goto]]##
- Use ##[[KeyPgSelectcase Select Case As Const]] //expr//## for the latter.
""9"") ##[[KeyPgResume Resume]]##
- See item 5 about ##[[KeyPgOptiondynamic Option Dynamic]]##.
""11"") ##[[KeyPgCall Call]]## or ##[[KeyPgLet Let]]##
- Named labels can be used instead, e.g. ##label_name:## / ##[[KeyPgGoto Goto]] label_name##.
**Supported:** //Anything allowed in the //[[CompilerOptlang -lang deprecated]]// dialect, plus..//
- Use ##[[KeyPgOptiongosub Option Gosub]]## to enable. This will disable ##RETURN## from exiting a procedure, due to ambiguity.
""1"") ##[[KeyPgScope Scope]]## blocks
- All variables are given procedure scope. Explicit ##[[KeyPgScope Scope]]## blocks may be added later.
**Supported:** //Everything not supported/allowed in the //[[CompilerOptlang -lang fb]]// dialect, plus..//
""1"") ##[[KeyPgCall Call]]## can be used with forward-referenced functions.
""2"") ##[[KeyPgShared Shared]]## can be used inside functions. (W.I.P.)
""4"") The ##[[KeyPgData Data]]## statement won't look up symbols, every token is assumed to be a literal string even without quotes, like in ""QuickBASIC"".
- None of the ##[[CatPgThreading threading]]## procedures may be used.
""4"") Constructors, destructors and other member procedures in ##[[KeyPgType Type]]## definitions.
""5"") ##[[KeyPgScope Scope]]## blocks
""6"") ##[[KeyPgExternBlock Extern]]## blocks


Revision [17453]

Edited on 2015-03-14 19:50:49 by CountingPine [Fix Select Case As Const syntax]
Additions:
- Use ##[[KeyPgSelectcase Select Case As Const]] //expr//## for the latter.
Deletions:
- Use ##SELECT expr AS CONST## for the latter.


Revision [17452]

Edited on 2015-03-14 19:48:09 by CountingPine [Line numbers: change "no comment" to brief explanation about labels.]
Additions:
- Named labels can be used instead, e.g. ##label_name:## / ##[[KeyPgGoto Goto]] label_name##.
Deletions:
- No comment.


Revision [17391]

Edited on 2014-12-16 08:04:45 by FxMwikki [Update of suffix meanings]
Additions:
- They are only allowed for numeric literals, but it's recommended to use ##[[KeyPgCast Cast]]## or the ##f## (##single##), ##d## (##double##), ##ll## (##longint##), ##ul## (##ulong##), ##ull## (##ulongint##) numeric literal suffixes to resolve overloading.
Deletions:
- They are only allowed for numeric literals, but it's recommended to use ##[[KeyPgCast Cast]]## or the ##f## (##single##), ##d## (##double##), ##ll## (##longint##), ##ul## (##uinteger##), ##ull## (##ulongint##) numeric literal suffixes to resolve overloading.


Revision [15158]

Edited on 2011-08-07 15:14:00 by FxMwikki [Update of suffix meanings]
Additions:
""9"") ##[[KeyPgResume Resume]]##
Deletions:
""9"") ##[[KeyPgOnerror On Error]]## or ##[[KeyPgResume Resume]]##


Revision [15037]

Edited on 2011-01-27 17:08:47 by CountingPine [Remove CamelCase links]
Additions:
""FreeBASIC"" version 0.17b introduces a //[[CompilerOptlang -lang]]// command-line option, used to change the language compatibility mode for different dialects of the basic language.
Starting with version 0.18.3b the //[[CompilerOptlang -lang qb]]// dialect has been further restricted to only allow what would have been allowed in [[QuickBASIC QuickBASIC]].
The //[[CompilerOptlang -lang]]// option was needed to allow ""FreeBASIC"" to support object-orientation and other features in the future, without crippling the ""QuickBASIC"" support or breaking compatibility with old ""FreeBASIC"" sources, and without making ""FreeBASIC"" difficult to maintain with many different versions of very similar packages. The ""QuickBASIC"" support can continue to be improved, if needed, without breaking the sources written specifically for ""FreeBASIC"".
Deletions:
FreeBASIC version 0.17b introduces a //[[CompilerOptlang -lang]]// command-line option, used to change the language compatibility mode for different dialects of the basic language.
Starting with version 0.18.3b the //[[CompilerOptlang -lang qb]]// dialect has been further restricted to only allow what would have been allowed in QuickBASIC.
The //[[CompilerOptlang -lang]]// option was needed to allow FreeBASIC to support object-orientation and other features in the future, without crippling the ""QuickBASIC"" support or breaking compatibility with old FreeBASIC sources, and without making FreeBASIC difficult to maintain with many different versions of very similar packages. The ""QuickBASIC"" support can continue to be improved, if needed, without breaking the sources written specifically for FreeBASIC.


Revision [14667]

Edited on 2010-06-19 04:23:39 by DkLwikki [Reverted previous change.]
Additions:
{{fbdoc item="back" value="DocToc|Table of Contents"}}
Deletions:
{{fbdoc item="back" value="FBWiki|Main Page"}}


Revision [14642]

Edited on 2010-06-15 11:33:46 by DkLwikki ["Back to Main" instead of "Back to TOC"]
Additions:
{{fbdoc item="back" value="FBWiki|Main Page"}}
Deletions:
{{fbdoc item="back" value="DocToc|Table of Contents"}}


Revision [13516]

The oldest known version of this page was created on 2008-07-15 22:15:08 by JeffMarshall ["Back to Main" instead of "Back to TOC"]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode