LenB function (LotusScript® Language)

Returns the length of a string in bytes, or the number of bytes used to hold a variable.

Syntax

LenB ( { stringExpr | variantExpr | numericExpr | typeName } )

Elements

stringExpr

Any string expression.

variantExpr

Any Variant expression that includes a variable name.

numericExpr

The name of a variable, an element of an array, an element of a list, or a member variable of a user-defined data type or class. The data type of numericExpr is numeric.

typeName

An instance of a user-defined data type. It can be a simple variable of that data type, or an element of an array variable or a list variable of that data type.

Return value

For stringExpr, LenB returns the number of bytes in the string expression.

For variantExpr, LenB returns the number of bytes required to hold the value of variantExpr converted to a String.

For numericExpr, LenB returns the number of bytes required to hold the contents of numericExpr.

For typeName, LenB returns the number of bytes required to hold the contents of all the member variables, unless the user-defined data type includes Variant or variable-length String members. In that case, the length of the variable of the user-defined data type may not be the same as the sum of the lengths of its member variables.

Usage

In LotusScript® Release 3 and after, LenB(NULL) generates an error. In previous releases of LotusScript®, LenB(NULL) returned NULL.

LenB(v), where v is EMPTY, returns 0.

To determine the length of a string in characters, use the Len function. To determine the length of a string in bytes in the platform-native character set, use the LenBP function.

Example