Parcsiz()

From Lianjapedia
Jump to: navigation, search

PURPOSE

Return the size of a character parameter

SYNONYM

api_parcsiz()

SYNOPSIS

#include "lianja_api.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 an 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 Lianja script:

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

Example 'C' function:

#include "lianja_api.h"
 
lianjaapi_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()