###
Examples

Create an integer array, I by entering:

I = INTARR(4, 5, 3, 6)

Find the number of elements in I and print the result by entering:

PRINT, N_ELEMENTS(I)

To test if the variable Q is defined and, if not, set its value to 1, use the command:

IF N_ELEMENTS(Q) EQ 0 THEN Q=1

A typical use of N_ELEMENTS is to check if an optional input is defined, and if not, set it to a default value:

IF (N_ELEMENTS(roo) EQ 0) THEN roo=rooDefault

The original value of ```
roo
```

may be altered by a called routine, passing a different value back to the caller. Unless you intend for the routine to behave in this manner, you should prevent it by differentiating N_ELEMENTS' parameter from your routine's variable:

IF (N_ELEMENTS(roo) EQ 0) THEN rooUse=roo $

ELSE rooUse=rooDefault