Difference between revisions of "Parl()"
From Lianjapedia
Yvonne.milne (Talk | contribs) m (1 revision) |
Yvonne.milne (Talk | contribs) m (Text replace - "lianjaapi.h" to "lianja_api.h") |
||
Line 7: | Line 7: | ||
==SYNOPSIS== | ==SYNOPSIS== | ||
<code lang="c"> | <code lang="c"> | ||
− | #include " | + | #include "lianja_api.h" |
int _parl(order [,index]) ) | int _parl(order [,index]) ) | ||
Line 36: | Line 36: | ||
<code lang="c"> | <code lang="c"> | ||
− | #include " | + | #include "lianja_api.h" |
lianjaapi_ltow() | lianjaapi_ltow() |
Latest revision as of 08:56, 11 April 2013
PURPOSE
Convert a logical to an integer
SYNONYM
api_par_l()
SYNOPSIS
#include "lianja_api.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 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 Lianja script:
m_condition=.t. m_word =ltow(m_condition) return
Example 'C' function:
#include "lianja_api.h" lianjaapi_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 ); }