Revision history for KeyPgTypeof


Revision [22331]

Last edited on 2018-06-08 14:32:27 by fxm [Added explanation on using the syntax TYPEOF((namespace_name.variable))]
Additions:
When a variable from a given namespace is accessed with the namespace's name prefix, wrap the argument to ##**Typeof**## with parentheses to force it to be seen as an expression. For example ##Typeof((namespace_name.variable))##.


Revision [21162]

Edited on 2016-03-13 11:27:32 by fxm [Formatting]

No Differences

Revision [20563]

Edited on 2016-02-10 16:09:49 by DkLwikki [Update link format]
Additions:
A [[DataType|DataType]].
##**Typeof**## also supports passing any intrinsic data type, or user-defined type, not only variables defined as those types. Also supported are expressions, the type is inferred from the expression (much like ##[[KeyPgVar|Var]]##).
- Not available in the //[[CompilerOptlang|-lang qb]]// dialect unless referenced with the alias ##**""__Typeof""**##.
- ##[[KeyPgSizeof|Sizeof]]##
- ##[[KeyPgVar|Var]]##
- ##[[KeyPgTypeAlias|Type (Alias)]]##
- ##[[KeyPgType|Type...End Type]]##
Deletions:
A [[DataType DataType]].
##**Typeof**## also supports passing any intrinsic data type, or user-defined type, not only variables defined as those types. Also supported are expressions, the type is inferred from the expression (much like ##[[KeyPgVar Var]]##).
- Not available in the //[[CompilerOptlang -lang qb]]// dialect unless referenced with the alias ##**""__Typeof""**##.
- ##[[KeyPgSizeof Sizeof]]##
- ##[[KeyPgVar Var]]##
- ##[[KeyPgTypeAlias Type (Alias)]]##
- ##[[KeyPgType Type...End Type]]##


Revision [17658]

Edited on 2015-05-29 13:31:43 by FxMwikki [As already done for LEN/SIZEOF, added explanation on usage of TYPEOF((variable))]
Additions:
##**Typeof**## also supports passing any intrinsic data type, or user-defined type, not only variables defined as those types. Also supported are expressions, the type is inferred from the expression (much like ##[[KeyPgVar Var]]##).
If there is both a user defined type and a variable visible with the same name in the current scope, the user defined type takes precedence over the variable. To ensure that the ##**Typeof**## takes the variable instead of the user defined type, wrap the argument to ##**Typeof**## with parentheses to force it to be seen as an expression. For example ##Typeof((variable))##.
Deletions:
##**Typeof**## also supports passing any intrinsic data type, or user-defined type, not only variables defined as those types. Also supported are expressions, the type is inferred from the expression (much like ##[[KeyPgVar Var]]##)


Revision [16912]

Edited on 2013-08-09 14:43:39 by DkLwikki [Adjust example]
Additions:
#if TypeOf(foo) = TypeOf(Integer)
#if TypeOf(foo) = TypeOf(String)
#print "It's a String!"
Deletions:
#if TypeOf(foo) = Integer


Revision [16206]

Edited on 2012-06-19 08:53:53 by CountingPine [Formatting, minor example changes]
Additions:
##**Typeof**## is a compiler intrinsic that replaces itself with the type of the variable passed to it. It can either be used in a variable declaration (Example 1) or it can be used in the preprocessor for comparison, printing. (Example 2)
##**Typeof**## also supports passing any intrinsic data type, or user-defined type, not only variables defined as those types. Also supported are expressions, the type is inferred from the expression (much like ##[[KeyPgVar Var]]##)
Print SizeOf(teh_double)
#endif
- ##[[KeyPgSizeof Sizeof]]##
- ##[[KeyPgVar Var]]##
- ##[[KeyPgTypeAlias Type (Alias)]]##
Deletions:
Typeof is a compiler intrinsic that replaces itself with the type of the variable passed to it. It can either be used in a variable declaration (Example 1) or it can be used in the preprocessor for comparison, printing. (Example 2)
Typeof also supports passing any intrinsic data type, or user-defined type, not only variables defined as those types. Also supported are expressions, the type is inferred from the expression (much like [[KeyPgVar Var]])
Print Len(teh_double)
#endIf


Revision [15213]

Edited on 2011-09-03 05:50:35 by ChA0s [Formatting, minor example changes]
Additions:
- Not available in the //[[CompilerOptlang -lang qb]]// dialect unless referenced with the alias ##**""__Typeof""**##.
Deletions:
- Not available in the //[[CompilerOptlang -lang qb]]// dialect unless referenced with the alias __Typeof.


Revision [15212]

Edited on 2011-09-03 05:49:52 by ChA0s [Formatting, minor example changes]
Additions:
- Not available in the //[[CompilerOptlang -lang qb]]// dialect unless referenced with the alias __Typeof.
Deletions:
- Not available in the //[[CompilerOptlang -lang qb]]// dialect.


Revision [14454]

Edited on 2009-08-29 21:57:21 by CountingPine [Remove CamelCase links in "New to FreeBASIC"]
Additions:
- New to ""FreeBASIC""
Deletions:
- New to FreeBASIC


Revision [12454]

The oldest known version of this page was created on 2008-01-18 14:26:40 by JeffMarshall [Remove CamelCase links in "New to FreeBASIC"]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode