Paro()

From Lianjapedia
Jump to: navigation, search

PURPOSE

Return an object pointer to an object

SYNONYM

api_par_o()

SYNOPSIS

#include "lianja_api.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 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 an 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 Lianja script:

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

Example 'C' function:

#include "lianja_api.h"
 
lianjaapi_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()