Difference between revisions of "Reto()"

From Lianjapedia
Jump to: navigation, search
 
m (1 revision)
(No difference)

Revision as of 06:35, 11 April 2013

PURPOSE

Return an object as an object type

SYNONYM

api_ret_o()

SYNOPSIS

#include "lianjaapi.h"
 
int	_reto(OBJECT)
 
<input parameters>
char	OBJECT;		/*Address of an object	*/
 
<output parameters>
none

DESCRIPTION

The _reto() function returns an object as an object type.

EXAMPLE

The following example evaluates the first parameter passed to a string and then returns the result.

Example Lianja script:

m_name="NewObj"
m_obj=obj_excp(m_name)
return

Example 'C' function:

#include "lianjaapi.h"
 
lianjaapi_obj_excp ()
{	
	OBJECT	objptr;
    char		name[33];
 
    if ( _parinfo(1) == API_CTYPE ) {
       strncpy( name, _parcs(1));
       name[32] = '0';
    } else {
       ERROR("Invalid Parameter.");
    }
 
	objptr = OBJECT_NEW(name, "exception", NULL); 	
    _reto (objptr );
}

SEE ALSO

_paro(), ISOBJECT()