Difference between revisions of "TYPE()"
Yvonnemilne (Talk | contribs) |
(→Description) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
Function to return a letter code that represents a data type | Function to return a letter code that represents a data type | ||
Line 12: | Line 8: | ||
==See Also== | ==See Also== | ||
− | [[BIN2I()]], [[BIN2L()]], [[BIN2W()]], [[CAST()]], [[CTOD()]], [[CTOT()]], [[DTOC()]], [[DTOM()]], [[DTOS()]], [[DTOV()]], [[ERROR()]], [[ERRNO()]], [[ETOS()]], [[I2BIN()]], [[ISALPHA()]], [[ISDIGIT()]], [[L2BIN()]], [[MESSAGE()]], [[MTOS()]], [[ON ERROR]], [[STR()]], [[STRZERO()]], [[TTOC()]], [[TTOD()]], [[VAL()]], [[VARTYPE()]], [[VTOD()]] | + | [[ATOH()]], [[BIN2I()]], [[BIN2L()]], [[BIN2W()]], [[CAST()]], [[CTOD()]], [[CTOT()]], [[DTOC()]], [[DTOM()]], [[DTOS()]], [[DTOV()]], [[ERROR()]], [[ERRNO()]], [[ETOS()]], [[HTOA()]], [[I2BIN()]], [[ISALPHA()]], [[ISDIGIT()]], [[L2BIN()]], [[MESSAGE()]], [[MTOS()]], [[ON ERROR]], [[STR()]], [[STRZERO()]], [[TTOC()]], [[TTOD()]], [[VAL()]], [[VARTYPE()]], [[VTOD()]] |
Line 24: | Line 20: | ||
|ARRAY (STATIC)||A | |ARRAY (STATIC)||A | ||
|- | |- | ||
− | |ARRAY (DYNAMIC||O | + | |ARRAY (DYNAMIC)||O |
|- | |- | ||
|BIGINT||N | |BIGINT||N | ||
Line 96: | Line 92: | ||
If <expC> contains a syntax error, or an undeclared variable, then TYPE() returns 'U'. TYPE() will also return a 'U' for an undefined variable if SET CLIPPER is ON. TYPE() is primarily used to check for the existence of a variable, or the syntax of an expression. | If <expC> contains a syntax error, or an undeclared variable, then TYPE() returns 'U'. TYPE() will also return a 'U' for an undefined variable if SET CLIPPER is ON. TYPE() is primarily used to check for the existence of a variable, or the syntax of an expression. | ||
− | |||
==Example== | ==Example== | ||
Line 107: | Line 102: | ||
==Products== | ==Products== | ||
− | Recital | + | Recital, Recital Server |
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
[[Category:Expressions and Type Conversion]] | [[Category:Expressions and Type Conversion]] | ||
[[Category:Expressions and Type Conversion Functions]] | [[Category:Expressions and Type Conversion Functions]] |
Latest revision as of 15:54, 3 February 2011
Purpose
Function to return a letter code that represents a data type
Syntax
TYPE(<expC>)
See Also
ATOH(), BIN2I(), BIN2L(), BIN2W(), CAST(), CTOD(), CTOT(), DTOC(), DTOM(), DTOS(), DTOV(), ERROR(), ERRNO(), ETOS(), HTOA(), I2BIN(), ISALPHA(), ISDIGIT(), L2BIN(), MESSAGE(), MTOS(), ON ERROR, STR(), STRZERO(), TTOC(), TTOD(), VAL(), VARTYPE(), VTOD()
Description
The TYPE() function returns a letter code which represents the data type of the expression in <expC>. The return value of the letter code is a character string from the table below.
Data type | Return Value |
---|---|
ARRAY (STATIC) | A |
ARRAY (DYNAMIC) | O |
BIGINT | N |
BIT | L |
BYTE | N |
CHARACTER | C |
CURRENCY | Y |
DATE | D |
DATETIME | T |
DECIMAL | N |
DOUBLE | N |
FLOAT | N |
GENERAL | G |
INTEGER | N |
LOGICAL | L |
LONG VARCHAR | M |
LONG VARBINARY | G |
MEDIUMINT | N |
MEMO | M |
NUMERIC | N |
OBJECT | O |
PACKED | N |
QUAD | N |
REAL | N |
SHORT | N |
SMALLINT | N |
Syntax error | U |
TEXT | M |
TIME | C |
TIMESTAMP | T |
TINYINT | N |
Undefined | U |
VAXDATE | C |
VARCHAR | C |
ZONED NUMERIC | C |
If <expC> contains a syntax error, or an undeclared variable, then TYPE() returns 'U'. TYPE() will also return a 'U' for an undefined variable if SET CLIPPER is ON. TYPE() is primarily used to check for the existence of a variable, or the syntax of an expression.
Example
i = 10 ? type("i") N
Products
Recital, Recital Server