$FUNCNAME$
  TYPE()
$CATEGORY$
  STRING,NUMERIC,DATE/TIME,LOGICAL,ARRAY,OBJECT,INFO
$SUMMARY$
   Determine the type of an expression
$LANG_RU$
     .
$SYNTAX$
     TYPE(<cExp>) --> cType
$LANG_RU$
     TYPE(< >) --> 
$ARGUMENTS$
     <cExp> is a character expression whose type is to be determined.
     <cExp> can be a field, with or without the alias, a private or public
     variable, or an expression of any type.
$LANG_RU$
     < > -  ,   
         . < > 
       ,     , PRIVATE 
     PUBLIC ,    .
$RETURNS$
     TYPE() returns one of the following characters:

     <PRE>TYPE() Return Values
     ------------------------------------------------------------------------
     Returns   Meaning
     ------------------------------------------------------------------------
     A         Array
     B         Block
     C         Character
     D         Date
     L         Logical
     M         Memo
     N         Numeric
     O         Object
     U         NIL, local, or static
     UE        Error syntactical
     UI        Error indeterminate
     ------------------------------------------------------------------------
     </PRE>
$LANG_RU$
      TYPE()     :

     <PRE>  TYPE().
     ---------------------------------------------------------------------
             
     ---------------------------------------------------------------------
     A                
     B                
     C                
     D                
     L                 
     M                 
     N                
     O                
     U                NIL, LOCAL  STATIC 
     UE                
     UI                
     ---------------------------------------------------------------------
     </PRE>
$DESCRIPTION$

     TYPE() is a system function that returns the type of the specified
     expression.  It can test expression validity as long as the expression
     uses xCLIPPER.LIB functions and does not reference local or static
     variables, user-defined functions, or built-in functions supplied in
     EXTEND.LIB.

     TYPE() is like VALTYPE() but uses the macro operator (&amp;) to determine
     the type of the argument.  This precludes the use of TYPE() to determine
     the type of local and static variables.  VALTYPE(), by contrast,
     evaluates an expression and determines the data type of the return
     value.  This lets you determine the type of user-defined functions as
     well as local and static variables.
$LANG_RU$
     TYPE() -  ,    . 
             
          xCLIPPER.LIB .  
           LOCAL  STATIC ,
           EXTEND.LIB.

      TYPE()    VALTYPE(),  
        (&amp;)   
     .    TYPE()    LOCAL 
     STATIC . VALTYPE()     
       .     
        ,  LOCAL  STATIC .
$EXAMPLES$
       These examples demonstrate various results from invocations of
	TYPE():

	? TYPE('SUBSTR("Hi There", 4, 5)')      // Result: C
	? TYPE("UDF()")                         // Result: UI
	? TYPE('IF(.T., "true", 12)')           // Result: C

       This example shows two methods for testing for the existence
	and type of declared parameters:

	FUNCTION TestParams
	   PARAMETERS cParam1, nParam2
	   IF cParam1 = NIL
	      ? "First parameter was not passed"
	      cParam1 := "Default value"
	   ENDIF

	   IF TYPE('nParam2') == "U"
	      ? "Second parameter was not passed"
	   ENDIF
	   .
	   . <statements>
	   .
	   RETURN NIL
$LANG_RU$
            
       TYPE():

       ? TYPE('SUBSTR(" ", 4, 5)')    // : C
       ? TYPE("UDF()")                          // : UI
       ? TYPE('IF(.T., "", 12)')          // : C

              
        :

       FUNCTION TestParams( cParam1, nParam2 )
	  IF cParam1 = NIL
	     ? "   "
	     cParam1 := "  "
	  ENDIF
	  //
	  IF VALTYPE(nParam2) !== "N"
	     ? "      "
	  ENDIF
	  .
	  . <>
	  .
	  RETURN NIL
$SEEALSO$
  VALTYPE()
$END$
