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>_parinfa() parameter type-checking of array elements</b> http://www.ousob.com [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
_parinfa()         Parameter type-checking of array elements


Syntax Usage:  #include     "extend.h"

               int          _parinfa(order [,index])

               int          order;  Placement of the array in
                                    parameter list
               int          index;  Array element index

Description:   _parinfa() returns type of an array element and is used
               for parameter type-checking.  Since Clipper arrays can
               have mixed type elements, each one must be type-checked
               before it can be used.

               Note that _parinfa(<order>, 0) returns the number of
               array elements.

----------------------------------- Example --------------------------------

   The following is an array defined in Clipper and displays to the
   screen all the elements formatted according to data type from a C
   function.

   In Clipper:

    DECLARE array[2]
    array[1] = "Deborah"
    array[2] = 456

    ArrFunc(array)


   In C:

    #include "extend.h"

    CLIPPER arrfunc()
    {
        int x;

        for (x = 1; x  <= _parinfa(1, 0); ++x)
        {
            /* string variables */
            if (_parinfa(1, x) == CHARACTER)
            {
                cprintf("%s\n", _parc(1, x));
            }

            /* integer or floating point */
            if (_parinfa(1, x) == NUMERIC)
            {
                cprintf("%u\n", _parni(1, x));
            }
            }
    }

Online resources provided by: http://www.ousob.com --- NG 2 HTML conversion by Dave Pearson