Parclen()
From Lianjapedia
Revision as of 08:51, 11 April 2013 by Yvonne.milne (Talk | contribs)
PURPOSE
Return the length of a character string
SYNONYM
api_par_clen()
SYNOPSIS
#include "lianja_api.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 an 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 Lianja script:
m_string="TUESDAY" m_len=string( m_string ) return
Example 'C' function:
#include "lianja_api.h" lianjaapi_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()