Pards()

From Recital Documentation Wiki
Revision as of 12:46, 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 date string


SYNONYM

api_par_ds()


SYNOPSIS

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


DESCRIPTION

The _pards() function gets a date parameter from Recital and returns a character pointer in the form of "YYYYMMDD". 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 _pards(). 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_date=date()
m_ansidate =date_ansi( m_date )
return

Example 'C' function:

#include "dbapi.h"
 
dbapi_date_ansi()
{
    char	date[9];
 
    if (_parinfo(1) == API_DTYPE ) {
       strcpy( date, _pards(1));
    } else {
       strcpy( date, "" );
    }
 
    _retc( date );
}


SEE ALSO

_retds(), DATE_STOD(), ISDATE()