Parclen()
From Recital Documentation Wiki
Revision as of 12:47, 30 March 2009 by Yvonnemilne (Talk | contribs)
PURPOSE
Return the length of a character string
SYNONYM
api_par_clen()
SYNOPSIS
#include "dbapi.h" int _parclen(order [,index]) <input parameters> int order; /* Placement in actual parameter list */ int index; /* Array element index */ <output parameters> none
DESCRIPTION
The _parclen() function returns the length of a character string passed as a parameter. It will return the length of a string without counting 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 will return the length of the character string passed in the first parameter.
Example Recital program:
m_string="RECITAL" m_len=string( m_string ) return
Example 'C' function:
#include "dbapi.h" dbapi_string_length() { int stringlen; if ( _parinfo(1) == API_CTYPE ) { stringlen = _parclen(1); } else { stringlen=0; } _retni( stringlen ); }
SEE ALSO
_parc(), _parcsiz(), _parinfo(), _retc(), _retclen(), ISCHAR(), CHAR_ALLTRIM(), CHAR_LOWER(), CHAR_LPAD(), CHAR_LTRIM(), CHAR_RPAD(), CHAR_RTRIM(), CHAR_STR(), CHAR_UPPER(), DATE_STOD()