Retds()

From Lianjapedia
Jump to: navigation, search

PURPOSE

Return a date string

SYNONYM

api_ret_ds()

SYNOPSIS

#include "lianja_api.h"
 
int	_retds(string)
 
<input parameters>
char	*string;		/*Address of a buffer containing a character string	*/
 
<output parameters>
none

DESCRIPTION

The _retds() function returns a character string in the format of "YYYYMMDD" as a date type. The DATE_DTOS() function can be used to convert a date stored as an unsigned long to a string format.

EXAMPLE

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

Example Lianja script:

m_date=date()
m_date=date_con(m_date)
return

Example 'C' function:

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

SEE ALSO

_parc(), _parclen(), _parcsiz(), _parinfo(), _retc(), _retclen(), ISCHAR(), CHAR_ALLTRIM(), CHAR_LOWER(), CHAR_LPAD(), CHAR_LTRIM(), CHAR_RPAD(), CHAR_RTRIM(), CHAR_STR(), CHAR_UPPER(), DATE_DTOS(), DATE_STOD()