Parc()

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

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

PURPOSE

Pass a pointer to a Recital character string


SYNONYM

api_par_c()


SYNOPSIS

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


DESCRIPTION

The _parc() function is used for getting a character parameter from Recital. 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.

NOTE: There is only one pointer on the stack for _parc(). The 'C' strcpy() function must be used to copy the result to a variable, you cannot simply pass the pointer.


EXAMPLE

The following example returns the character string passed in the first parameter.

Example Recital program:

m_string="RECITAL"
m_string=string( m_string )
return

Example 'C' function:

#include "dbapi.h"
 
dbapi_string()
{
    char string[9];
 
    if ( _parinfo(1) == API_CTYPE ) {
       strcpy( string, _parc(1));
    } else {
       strcpy( string, "" );
    }
 
    _retc( string );
}


SEE ALSO

_parclen(), _parcsiz(), _parinfo(), _retc(), _retclen(), ISCHAR(), CHAR_ALLTRIM(), CHAR_LOWER(), CHAR_LPAD(), CHAR_LTRIM(), CHAR_RPAD(), CHAR_RTRIM(), CHAR_STR(), CHAR_UPPER(), DATE_STOD()