Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>type()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
TYPE()


Syntax:     TYPE(<expC>)

Purpose:    To return the type of the specified character expression.

Argument:   <expC> is a character expression whose content type will
            be determined.  This can include a field, with or without
            the alias, a memory variable, or an expression of any type.

Returns:    TYPE() returns one of the following characters:

            Table: TYPE() Return Values
            ------------------------------------------------
            Returns        Meaning
            ------------------------------------------------
               C           Character
               D           Date
               L           Logical
               N           Numeric
               M           Memo field
               A           Array
               U           Undefined
               UE          Error syntactical
               UI          Error indeterminate
            ------------------------------------------------

Usage:      TYPE() returns the type of the specified expression.  With
            its expanded capabilities, it can be used to test expression
            validity.  There are, however, several special cases to
            note:

            Array references: References to DECLAREd arrays return
            an "A."  References to array elements return the type of the
            element.  Invalid references return "U."

            IF()/IIF(): In order to return the appropriate data type
            for an IF(), TYPE() evaluates the condition and then returns
            the type of the evaluated path.  If either the IF()
            condition or the evaluated path are invalid, TYPE() returns
            "UE."

            User-defined and EXTEND.LIB functions: If a reference is
            made anywhere in an expression to a function not found in
            CLIPPER.LIB (a user-defined or EXTEND.LIB function), TYPE()
            returns "UI."  If the user-defined function is not linked
            into the current program, TYPE() returns "U."

Library:    CLIPPER.LIB


----------------------------------- Examples -------------------------------

   ? TYPE("Alias_name->Fldvar")
   ? TYPE([SUBSTR("Hi There", 4, 5)])     && Result: C
   ? TYPE([UDF()])                        && Result: UI
   ? TYPE([IF(.T., "true", 12)])          && Result: C


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson