$FUNCNAME$
  LEN()
$CATEGORY$
  ARRAY,STRING,NUMERIC,INFO
$SUMMARY$
   Return the length of a character string or the number of elements in an array
$LANG_RU$
           .
$SYNTAX$
     LEN(<cString> | <aTarget>) --> nCount
$LANG_RU$
     LEN(< > | <>) --> 
$ARGUMENTS$
     <cString> is the character string to count.

     <aTarget> is the array to count.
$LANG_RU$
     < > -  .

     <> - .
$RETURNS$
     LEN() returns the length of a character string or the number of elements
     in an array as an integer numeric value.  If the character string is a
     null string ("") or the array is empty, LEN() returns zero.
$LANG_RU$
     LEN()       
          .     
     ,  LEN()  .
$DESCRIPTION$
     LEN() is a character and array function that returns the length of a
     character string or the number of elements in an array.  With a
     character string, each byte counts as one, including an embedded null
     byte (CHR(0)).  By contrast, a null string ("") counts as zero.

     For an array, LEN() returns the number of elements.  If the array is
     multidimensional, subarrays count as one element.  This means that the
     LEN() of a nested or multidimensional array simply returns the length of
     the first dimension.  To determine the number of elements in other
     dimensions, use LEN() on the subarrays as shown in the example below.
     Note that nested arrays in xClipper need not have uniform dimensions.
$LANG_RU$
     LEN()       ,
            
      .     ,    
     (CHR(0)),    .    ("") 
     0.

        LEN()     . 
       ,     
     .  ,      
     LEN()    .   
        ,   LEN() 
     ,    .  ,  
       xClipper      .
$EXAMPLES$
       These examples demonstrate LEN() with various arguments:

	? LEN("string of characters")         // Result: 20
	? LEN("")                              // Result: 0
	? LEN(CHR(0))                        // Result: 1
	//
	LOCAL aTest[10]
	? LEN(aTest)                           // Result: 10

       This example creates a literal two-dimensional array, and then
	returns the number of elements in the subarray contained in the first
	element of the original array:

	LOCAL aArray := { {1, 2}, {1, 2}, {1, 2} }
	? LEN(aArray)                        // Result: 3
	? LEN(aArray[1])                     // Result: 2

       This example navigates a multidimensional array using LEN():

     LOCAL aArray := { {1, 2}, {1, 2}, {1, 2} }
	LOCAL nRow, nColumn, nRowCount, nColumnCount

	//
	nRowCount = LEN(aArray)
	FOR nRow = 1 TO nRowCount
	   nColumnCount = LEN(aArray[nRow])
	   FOR nColumn = 1 TO nColumnCount
	      ? nRow, nColumn, aArray[nRow][nColumn]
	   NEXT
	NEXT

       In this example a function returns an array of numeric values
	that describe the dimensions of a nested or multidimensional array.
	The function assumes that the array has uniform dimensions:

	FUNCTION Dimensions( aArray )
	   LOCAL aDims := {}
	   DO WHILE ( VALTYPE(aArray) == "A" )
	      AADD( aDims, LEN(aArray) )
	      aArray := aArray[1]
	   ENDDO
	   RETURN (aDims)
$LANG_RU$
           LEN()  
       :

       ? LEN(" ")        // : 15
       ? LEN("")                       // : 0
       ? LEN(CHR(0))                   // : 1
       //
       LOCAL aTest[10]
       ? LEN(aTest)                    // : 10

              
         ,     
       :

       LOCAL aArray:= {{1,2}, {1,2}, {1,2}}
       ? LEN(aArray)                   // : 3
       ? LEN(aArray[1])                // : 2

        ,     
       ,  LEN():

       LOCAL aArray := { { 1, 2}, { 1, 2}, { 1, 2} }
       LOCAL nRow, nColumn, nRowCount, nColumnCount
       //
       nRowCount = LEN(aArray)
       FOR nRow = 1 TO nRowCount
	  nColumnCount = LEN(aArray[nRow])
	  FOR nColumn = 1 TO nColumnCount
	     ? nRow, nColumn, aArray[nRow][nColumn]
	  NEXT
       NEXT

          ,   
        ,     
       .  ,     :

       FUNCTION Dimensions( aArray )
	  LOCAL aDims := {}
	  DO WHILE ( VALTYPE(aArray) == "A" )
	     AADD( aDims, LEN(aArray) )
	     aArray := aArray[1]
	  ENDDO
	  RETURN (aDims)
$SEEALSO$
  AADD(),ASIZE(),LTRIM(),RTRIM()
$END$
