[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _parinfo()
 Determine the parameter count or the data type of a parameter
------------------------------------------------------------------------------
 C Prototype

     #include "extend.api"
     int _parinfo(
                   int iParamNum
                 )

 Arguments

     iParamNum is the one-based ordinal position of the parameter in the
     parameter list.

 Returns

     If iParamNum is zero, _parinfo() returns the number of parameters passed
     from CA-Clipper.  Otherwise, _parinfo() returns an integer value
     representing the data type of the indicated parameter.  The following
     table summarizes the type codes:

     _parinfo() Return Values
     ------------------------------------------------------------------------
     Value   CA-Clipper Type          Extend.api Manifest Constant
     ------------------------------------------------------------------------
     0       NIL                      UNDEF
     1       Character                CHARACTER
     2       Numeric                  NUMERIC
     4       Logical                  LOGICAL
     8       Date                     DATE
     32      Passed by reference      MPTR
     65      Memo                     MEMO
     512     Array                    ARRAY
     ------------------------------------------------------------------------

 Description

     _parinfo() determines either the CA-Clipper data type of a parameter or
     the number of parameters passed.  You can also determine the number of
     parameters passed by using the PCOUNT macro defined in Extend.api.

     To use _parinfo() to determine if a parameter is of a particular type
     and was also passed by reference, perform a logical OR of the desired
     type code and the MPTR code; then test for the resulting value.  For
     example, when a CA-Clipper variable containing a character value is
     passed by reference, _parinfo() returns 33: MPTR (32) OR'ed with
     CHARACTER (1).

     The ISBYREF() macro defined in Extend.api also determines if a parameter
     is passed by reference.  This pseudofunction accepts a parameter number
     as its argument and returns one, (TRUE), if the parameter was passed by
     reference.

 Examples

     .  From C:

        int count;
        int type;
        count = _parinfo(0);
        type = _parinfo(1);

     .  From Assembly language:

        EXTRN __parinfo:FAR
              mov   ax, 0
              push  ax
              call  __parinfo         ; count returned in AX
              add   sp, 2             ; reset stack pointer
              mov   ax, 1
              push  ax
              call  __parinfo         ; type code returned in AX
              add   sp, 2             ; reset stack pointer

 Files  Library is CLIPPER.LIB, header file is Extend.api.


See Also: _parinfa()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson