LENSDP function

Syntax

LENSDP (dynamic.array [, mapname ] )
CALL -LENSDP (return.array, dynamic.array [ ,mapname ] )
CALL !LENSDP (return.array, dynamic.array [ ,mapname ] )

Description

In NLS mode, use the LENSDP function to return a dynamic array of the number of display positions occupied by each element of dynamic.array. Calculations are based on display length rather than character length.

Each element of dynamic.array must be a string value. The display lengths of each element of dynamic.array are counted, and the counts are returned.

mapname is the name of an installed map. If mapname is not installed, the character length of string is returned.

If mapname is omitted, the map associated with the channel activated by PRINTER statement ON is used, otherwise it uses the map for print channel 0. You can also specify mapname as CRT, AUX, LPTR, and OS. These values use the maps associated with the terminal, auxiliary printer, print channel 0, or the operating system, respectively. If you specify mapname as NONE, the string is not mapped.

Any characters that cannot be mapped in dynamic.array have a display length of 1.

The LENSDP function includes all blank spaces, including trailing blanks, in the calculation.

If dynamic.array evaluates to the null value, 0 is returned. If any element of dynamic.array is null, 0 is returned for that element.

If you use the subroutine syntax, the resulting dynamic array is returned as return.array.

If you use the LENSDP function with NLS disabled, the program behaves as if the LENS function is used. See the LENS function to return the length of a string in character length rather than display length.