Click or drag to resize

EmptyUsual Function

X#
Return the empty value of a specified data type.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax
 FUNCTION EmptyUsual(
	kType AS DWORD
) AS USUAL
Request Example View Source

Parameters

kType
Type: DWord
The data type whose empty value is desired.
The constants defining all X# data types are listed in the table below.

Return Value

Type: Usual
The empty value of the data type specified by kType.
These values are as follows:
kTypeEmpty Value
ARRAYNULL_ARRAY or empty array
BYTE, DWORD0
FLOAT, INT0
LONGINT, REAL40
REAL8, SHORTINT 0
WORD0
CODEBLOCKNULL_CODEBLOCK
DATENULL_DATE
LOGICFALSE
OBJECTNULL_OBJECT
PSZNULL_PSZ
PTRNULL_PTR
STRINGSpaces, tabs, carriage return/line feed, or NULL_STRING
SYMBOLNULL_SYMBOL
USUAL NIL
VOIDNIL
Remarks
Examples
This example shows the result of EmptyUsual() for different data types:
X#
1? EmptyUsual(LOGIC)                // FALSE
2? EmptyUsual(SHORTINT)        // 0
3? EmptyUsual(STRING)            // NULL_STRING
This example passes the result of the EmptyUsual() function to the Empty() function:
X#
1? Empty(EmptyUsual(DATE))            // TRUE
2? Empty(EmptyUsual(LONGINT))    // TRUE
3? Empty(EmptyUsual(SYMBOL))      // TRUE
See Also