Revision history for KeyPgTypeof


Revision [26769]

Last edited on 2024-02-25 04:15:18 by fxm [Before fbc 1.10.0, 'Typeof' was not returning the type of the non-static member procedures]
Additions:
- Before fbc 1.10.0, ##**Typeof**## was not returning the type of the non-static member procedures of a UDT.


Revision [25568]

Edited on 2021-10-13 06:06:10 by fxm [formatted for .chm]
Additions:
##**Typeof**## was not returning the type of the data fields of a UDT.
When a variable from a given namespace was accessed with the namespace's name prefix, the argument to ##**Typeof**## had to be wrapped with parentheses to force it to be seen as an expression. For example ##Typeof((namespace_name.variable))##.
Deletions:
##**Typeof**## was not returning the type of the data fields of a UDT.
When a variable from a given namespace was accessed with the namespace's name prefix, the argument to ##**Typeof**## had to be wrapped with parentheses to force it to be seen as an expression. For example ##Typeof((namespace_name.variable))##.


Revision [25498]

Edited on 2021-10-12 04:31:09 by fxm [differences from versions previous to 1.08 transferred to the Version section]
Additions:
##**Typeof**## was not returning the type of the data fields of a UDT.
Deletions:
##**Typeof**## was not returning the size of the data fields of a UDT.


Revision [25494]

Edited on 2021-10-12 03:27:38 by fxm [differences from versions previous to 1.08 transferred to the Version section]
Additions:
##**Typeof**## also supports passing any intrinsic data type, or user-defined type (and its data fields), not only variables defined as those types. Also supported are expressions, the type is inferred from the expression (much like ##[[KeyPgVar|Var]]##).
Example 1:
{{fbdoc item="filename" value="examples/manual/misc/typeof1.bas"}}%%(freebasic)
%%
Example 2:
{{fbdoc item="filename" value="examples/manual/misc/typeof2.bas"}}%%(freebasic)
%%
{{fbdoc item="ver"}}
- Before fbc 1.08.0:
##**Typeof**## was not returning the size of the data fields of a UDT.
When a variable from a given namespace was accessed with the namespace's name prefix, the argument to ##**Typeof**## had to be wrapped with parentheses to force it to be seen as an expression. For example ##Typeof((namespace_name.variable))##.
Deletions:
##**Typeof**## also supports passing any intrinsic data type, or user-defined type (and its data fields for fbc version >= 1.08), not only variables defined as those types. Also supported are expressions, the type is inferred from the expression (much like ##[[KeyPgVar|Var]]##).
For fbc version < 1.08: 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))##.
Example 1:
{{fbdoc item="filename" value="examples/manual/misc/typeof1.bas"}}%%(freebasic)
%%
Example 2:
{{fbdoc item="filename" value="examples/manual/misc/typeof2.bas"}}%%(freebasic)
%%


Revision [23771]

Edited on 2019-12-11 03:13:39 by fxm [predisposed for fbc version 1.08]
Additions:
##**Typeof**## also supports passing any intrinsic data type, or user-defined type (and its data fields for fbc version >= 1.08), not only variables defined as those types. Also supported are expressions, the type is inferred from the expression (much like ##[[KeyPgVar|Var]]##).
For fbc version < 1.08: 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))##.
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]]##).
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 [22702]

Edited on 2019-06-10 08:28:34 by fxm [Cancelled previous update]
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))##.
Deletions:
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 (same for a member field in a type/union accessed with the instance's name prefix). For example ##Typeof((namespace_name.variable))##.


Revision [22698]

Edited on 2019-06-10 08:18:49 by fxm [Syntax for accessing a member field of a type/union is similar to the one for a variable in a namespace]
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 (same for a member field in a type/union accessed with the instance's name prefix). For example ##Typeof((namespace_name.variable))##.
Deletions:
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 (same for a member field in a type/union). For example ##Typeof((namespace_name.variable))##.


Revision [22696]

Edited on 2019-06-10 07:59:35 by fxm [Syntax for accessing a member field of a type/union is similar to the one for a variable in a namespace]
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 (same for a member field in a type/union). For example ##Typeof((namespace_name.variable))##.
Deletions:
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 [22331]

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