Revision history for ProPgImplicitdeclarations


Revision [21675]

Last edited on 2016-11-07 07:07:00 by fxm [Formatting]

No Differences

Revision [21211]

Edited on 2016-03-13 12:52:45 by fxm [Formatting]
Additions:









Revision [20641]

Edited on 2016-02-10 16:12:55 by DkLwikki [Update link format]
Additions:
The //[[CompilerOptlang|qb]]// and //[[CompilerOptlang|fblite]]// ""FreeBASIC"" language dialects allow variable names to be used without declaring them first. This is called implicit or lazy declaration since the actual declaration is inferred from how the name is first used.
In the //[[CompilerOptlang|qb]]// dialect, implicitly declared variables default to ##[[KeyPgSingle|Single]]## type, while in the //[[CompilerOptlang|fblite]]// dialect they default to ##[[KeyPgInteger|Integer]]## type.
"##DEFxxx##" directives dictate the new default type for any following implicit variable declarations. These directives are: ##[[KeyPgDefbyte|DefByte]]##, ##[[KeyPgDefubyte|DefUByte]]##, ##[[KeyPgDefshort|DefShort]]##, ##[[KeyPgDefushort|DefUShort]]##, ##[[KeyPgDefint|DefInt]]##, ##[[KeyPgDefuint|DefUInt]]##, ##[[KeyPgDeflng|DefLng]]##, ##[[KeyPgDefsng|DefSng]]##, ##[[KeyPgDefdbl|DefDbl]]## and ##[[KeyPgDefstr|DefStr]]##.
Variable names suffixed with one of a certain set of symbols will be implicitly declared of a certain type. These symbols are: ##'%'## for ##[[KeyPgInteger|Integer]]##, ##'&'## for ##[[KeyPgLong|Long]]##, ##'!'## for ##[[KeyPgSingle|Single]]##, ##'#'## for ##[[KeyPgDouble|Double]]## and ##'$'## for ##[[KeyPgString|String]]##. These symbols override previous "##DEFxxx##" directives, if any.
For full debugging support, all variables must be explicitly declared and suffixes should not be used. The use of ##[[KeyPgOptionexplicit|Option Explicit]]## is recommended to turn of support for implicit declarations, so that mistyped variable names are caught at compile time by the compiler.
- ##[[KeyPgOptionexplicit|Option Explicit]]##
- [[CompilerOptlang|FreeBASIC Language Dialects]]
Deletions:
The //[[CompilerOptlang qb]]// and //[[CompilerOptlang fblite]]// ""FreeBASIC"" language dialects allow variable names to be used without declaring them first. This is called implicit or lazy declaration since the actual declaration is inferred from how the name is first used.
In the //[[CompilerOptlang qb]]// dialect, implicitly declared variables default to ##[[KeyPgSingle Single]]## type, while in the //[[CompilerOptlang fblite]]// dialect they default to ##[[KeyPgInteger Integer]]## type.
"##DEFxxx##" directives dictate the new default type for any following implicit variable declarations. These directives are: ##[[KeyPgDefbyte DefByte]]##, ##[[KeyPgDefubyte DefUByte]]##, ##[[KeyPgDefshort DefShort]]##, ##[[KeyPgDefushort DefUShort]]##, ##[[KeyPgDefint DefInt]]##, ##[[KeyPgDefuint DefUInt]]##, ##[[KeyPgDeflng DefLng]]##, ##[[KeyPgDefsng DefSng]]##, ##[[KeyPgDefdbl DefDbl]]## and ##[[KeyPgDefstr DefStr]]##.
Variable names suffixed with one of a certain set of symbols will be implicitly declared of a certain type. These symbols are: ##'%'## for ##[[KeyPgInteger Integer]]##, ##'&'## for ##[[KeyPgLong Long]]##, ##'!'## for ##[[KeyPgSingle Single]]##, ##'#'## for ##[[KeyPgDouble Double]]## and ##'$'## for ##[[KeyPgString String]]##. These symbols override previous "##DEFxxx##" directives, if any.
For full debugging support, all variables must be explicitly declared and suffixes should not be used. The use of ##[[KeyPgOptionexplicit Option Explicit]]## is recommended to turn of support for implicit declarations, so that mistyped variable names are caught at compile time by the compiler.
- ##[[KeyPgOptionexplicit Option Explicit]]##
- [[CompilerOptlang FreeBASIC Language Dialects]]


Revision [12906]

The oldest known version of this page was created on 2008-04-13 08:35:09 by JeffMarshall [Update link format]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode