LENGTH

Examples

LENGTH determines the length of a list. It is useful in PROCs which are passed lists as arguments, since the length may be required in matrix dimensions or degrees of freedom calculations. This command counts arguments; it does not compute the length of a series or a matrix.

LENGTH <list of variables or lists> <length of list> ;

Output

The list(s) on the command line are expanded, and the final total number of items is stored in the last argument.

Examples

Count the number of parameters from an estimation:

LSQ EQ1-EQ5;

LENGTH @RNMS NOPAR;

The following commands cause LENA to be stored with a value of 3, and LENAB to be stored with a value of 5:

LIST LA X Y Z;

LENGTH LA LENA;

LIST BB B1-B2;

LENGTH LA BB LENAB;