Parcsiz()

From Recital Documentation Wiki
Jump to: navigation, search

PURPOSE

Return the size of a character parameter


SYNONYM

api_par_csiz()


SYNOPSIS

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


DESCRIPTION

The _parcsiz() function returns the number of bytes in memory allocated for the character string including the NULL terminator. 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 returns the maximum string size of the character string passed as the first parameter.

Example Recital program:

m_string="RECITAL"
m_size=string_size( m_string )
return

Example 'C' function:

#include "dbapi.h"
 
dbapi_string_size()
{
    int	stringlen;
 
    if ( _parinfo(1) == API_CTYPE ) {
       stringlen = _parcsiz(1);
    } else {
       stringlen=0;
    }
 
    _retni(stringlen);
}


SEE ALSO

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