Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.3 . Technical Reference - <b>_parinfa()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _parinfa()
 Determine the length or element type of an array parameter
------------------------------------------------------------------------------
 C Prototype

     #include "extend.api"
     int _parinfa(
                   int iParamNum,
                   unsigned int uiArrayIndex
                 )

 Arguments

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

     uiArrayIndex is the array element index.

 Returns

     If uiArrayIndex is zero, _parinfa() returns the number of elements in
     the specified array.  Otherwise, _parinfa() returns an integer value
     that indicates the data type of the specified array element.  The type
     codes are summarized in the table below:

     _parinfa() 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

     _parinfa() determines the length of an array parameter or the type of
     one of its elements.  You can also determine the length of an array
     using the ALENGTH() macro defined in Extend.api.

     Warning!  Type checking is important since CA-Clipper arrays may
     contain mixed data types.  To assure that your Extend routine receives
     the correct data type, check the data type of each element before you
     use it.

 Examples

     .  From C:

        int len;
        int type;
        len = _parinfa(1, 0);
        type = _parinfa(1, 1);

     .  From Assembly language:

        EXTRN __parinfa:FAR
              mov   ax, 0             ; params pushed in reverse
              push  ax
              mov   ax, 1
              push  ax
              call  __parinfa         ; length returned in AX
              add   sp, 4             ; reset stack pointer
              mov   ax, 1
              push  ax
              push  ax
              call  __parinfa         ; type code returned in AX
              add   sp, 4             ; reset stack pointer

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


See Also: _parinfo()

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