Click or drag to resize

ToWord Function

X#
Convert a number to a word.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION ToWord(
	n AS USUAL
) AS DWORD
Request Example View Source

Parameters

n
Type: Usual

Return Value

Type: DWord
Remarks
ToWord() can be used in situations where a word is preferred or required, such as when passing arguments to a DLL function.
Tip Tip
ToWord() is the same as the Word() function in CA-Clipper, but WORD is a reserved word in X#.
Under X#, Word() is a conversion operator. With numbers that are not greater than a WORD type number, it yields the same results as ToWord() and maintains compatibility with CA-Clipper.
Examples
This example uses ToWord() as an argument to a function which expects a short integer:
X#
1LOCAL n := 30000 AS USUAL
2CProc(ToWord(n))
3FUNCTION CProc(siV AS SHORTINT)
4    ? siV
See Also