|list||An expression that resolves to a Caché list. A Caché list is created using $LISTBUILD or $LISTFROMSTRING, or extracted from another list using $LIST.|
$LISTLENGTH returns the number of elements in list.
The following example returns 3, because there are 3 elements in the list:
The following example returns a 0, because a null string is a valid (zero-element) list.
$LISTLENGTH and Nested Lists
The following example returns 3, because $LISTLENGTH does not recognize the individual elements in nested lists:
x=$LISTBUILD("Apple","Pear",$LISTBUILD("Walnut","Pecan")) PRINT $LISTLENGTH(x)