POSITION:028,114
COLOUR:STANDARD
TEXT:00,Once you've created your sequences, it's a good idea to know how large
TEXT:16,they are if you plan to examine one or many of the elements that make the
TEXT:16,sequence up. The length() library routine returns the length of a
TEXT:16,sequence in number of elements:
COLOUR:EUPHORIA
TEXT:32,   = length( )
COLOUR:POINTS
TEXT:00,ri          s
COLOUR:STANDARD
TEXT:32,The length of the sequence, shown here as  , is placed in the receiving
COLOUR:POINTS
TEXT:00,                                          s
COLOUR:STANDARD
TEXT:16,variable   . Note that the returned value is how long sequence   is in
COLOUR:POINTS
TEXT:00,         ri                                                    s
COLOUR:STANDARD
TEXT:16,elements, not atoms. This means the sequences {{1,1},{1,1}} and {1,1} are
TEXT:16,the same length in elements, even though the former contains more atoms.
TEXT:16,A sequence value of {}, which is a null sequence, returns a value of 0.
TEXT:32,A demo program is available to show how length() can be used in a "for"
TEXT:16,statement to create a loop that adjusts to the size of a sequence. The
TEXT:16,next chapter will introduce library routines that search sequences!

