Microsoft KB Archive/88975

{| = How to Use the TYPE Function =
 * width="100%"|

ID: Q88975

The information in this article applies to:


 * Microsoft FoxBASE+ for MS-DOS, versions 1.21 and 2.0
 * Microsoft FoxPro for MS-DOS, versions 1.0, 1.01, 1.02, 2.0, 2.5, and 2.5a
 * Microsoft FoxPro for Windows, versions 2.5 and 2.5a

The TYPE function returns the data type code for a specified expression. Quotation marks are required around the specified variable or field name used.

The following examples demonstrate the use of the TYPE function:

Example 1
x=1 ? TYPE(&quot;x&quot;)  && returns N

Example 2
x=&quot;TEST&quot; ? TYPE(&quot;x&quot;)  && returns C

Example 3
x=DATE ? TYPE(&quot;x&quot;)  && returns D

Example 4
x=1 ? TYPE(x)    && returns an ERROR

Example 5
x=&quot;TEST&quot; ? TYPE(x)    && returns U Example 4 returns an error because FoxPro tries to use x as a subscript. The last example returns U because the variable TEST does not exist. Additional reference words: FoxWin FoxDos 1.00 1.01 1.02 1.21 2.00 2.50 2.50a KBCategory: kbprg KBSubcategory: FxprgGeneral
 * }