Paro()

From Recital Documentation Wiki
Revision as of 12:39, 30 March 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PURPOSE

Return an object pointer to an object


SYNONYM

api_par_o()


SYNOPSIS

#include "dbapi.h"
 
char	*_paro(order [,index])
 
<input parameters>
int	order;		/* Placement in actual parameter list 	*/
int	index;		/* Array element index			*/
 
<output parameters>
none


DESCRIPTION

The _paro() function gets an object parameter from Recital and returns a pointer in the form of an OBJECT. The order specifies the actual placement in the parameter list. If the parameter passed is a Recital array, then the optional index value is used to specify the required element number.


EXAMPLE

The following example checks the first parameter passed is an object and then returns the number of properties.

Example Recital program:

m_exception=NEWOBJECT ('exception')
m_propcnt =object_propcnt( m_exception)
return

Example 'C' function:

#include "dbapi.h"
 
dbapi_object_protcnt()
{
	OBJECT objptr;
    int	cnt;
 
    if (_parinfo(1) == API_OTYPE ) {
       cnt  =  OBJECT_PARACNT(_paro(1));
    } else {
       ERROR("Invalid Parameter");
    }
 
    _retni( cnt );
}


SEE ALSO

_reto(), ISOBJECT(), OBJECT_NEW()