Difference between revisions of "Reto()"
From Lianjapedia
Yvonne.milne (Talk | contribs) m (1 revision) |
Yvonne.milne (Talk | contribs) m (Text replace - "lianjaapi.h" to "lianja_api.h") |
||
Line 7: | Line 7: | ||
==SYNOPSIS== | ==SYNOPSIS== | ||
<code lang="c"> | <code lang="c"> | ||
− | #include " | + | #include "lianja_api.h" |
int _reto(OBJECT) | int _reto(OBJECT) | ||
Line 35: | Line 35: | ||
<code lang="c"> | <code lang="c"> | ||
− | #include " | + | #include "lianja_api.h" |
lianjaapi_obj_excp () | lianjaapi_obj_excp () |
Latest revision as of 09:02, 11 April 2013
PURPOSE
Return an object as an object type
SYNONYM
api_ret_o()
SYNOPSIS
#include "lianja_api.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 "lianja_api.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 ); }