Parys()

From Recital Documentation Wiki
Revision as of 12:37, 30 March 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PURPOSE

Return a pointer to a currency string


SYNONYM

api_par_ys()


SYNOPSIS

#include "dbapi.h"
 
char	*_parys(order [,index])
 
<input parameters>
int	order;		/* Placement in actual parameter list 	*/
int	index;		/* Array element index				*/
 
<output parameters>
none


DESCRIPTION

The _parys() function gets a currency parameter from Recital and returns a character pointer. 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.

NOTE: there is only one pointer on the stack for _parys(). The 'C' strcpy() function must be used to copy the result to a variable, you cannot simple pass the pointer.


EXAMPLE

The following example copies the first parameter passed to a string and then returns the result.

Example Recital program:

m_currency=$23.8327
m_strcurr =currency_ctos( m_currency )
return

Example 'C' function:

#include "dbapi.h"
 
dbapi_currency_ctos()
{
    char	currency[32];
 
    if (_parinfo(1) == API_YTYPE ) {
       strcpy( currency, _parys(1));
    } else {
       strcpy( date, "" );
    }
 
    _retc( currency );
}


SEE ALSO

_parc(), _parclen(), _parcsiz(), _parinfo(), _retc(), _retclen(), _retys(), ISCURRENCY(), CURR_STOY(), CURR_YTOS()