Pards()

From Lianjapedia
Jump to: navigation, search

PURPOSE

Return a pointer to a date string

SYNONYM

api_par_ds()

SYNOPSIS

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

m_date=date()
m_ansidate =date_ansi( m_date )
return

Example 'C' function:

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