Parl()
From Recital Documentation Wiki
Revision as of 12:42, 30 March 2009 by Yvonnemilne (Talk | contribs)
PURPOSE
Convert a Recital logical to an integer
SYNONYM
api_par_l()
SYNOPSIS
#include "dbapi.h" int _parl(order [,index]) ) <input parameters> int order; /* Placement in actual parameter list */ int index; /* Array element index */ <output parameters> none
DESCRIPTION
The function converts a logical parameter passed from Recital to an integer, where .T. = 1 and .F. = 0. 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 logical passed in the first parameter in English.
Example Recital program:
m_condition=.t. m_word =ltow(m_condition) return
Example 'C' function:
#include "dbapi.h" dbapi_ltow() { char strbuff[6]; if ( _parinfo(1) == API_LTYPE ) { if ( _parl(1) == 0 ) { strcpy( strbuff, "False"); }else { strcpy( strbuff, "True"); } } else { strcby( strbuff, ""); } _retc( strbuff ); }