Click or drag to resize

Len Function

X#
Return the length of a string or an array.

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

Parameters

uValue
Type: Usual
The string or array to measure. In a string, each byte counts as 1, including an embedded null character (Chr(0)).
A NULL_STRING counts as 0. In an array, each element counts as 1.

Return Value

Type: DWord
The length of uValue.
Remarks
Tip Tip
ALen(), PszLen() and SLen() are the strongly typed versions of Len().
Examples
These examples demonstrate Len() with various arguments:
X#
1? LEN("string of characters")        // 20
2? LEN(NULL_STRING)                // 0
3? LEN(CHR(0))                    // 1
4LOCAL aTest[10]
5? LEN(aTest)                    // 10
6? LEN(ArrayNew(5))                // 5
See Also