[<<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()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson