Function _conPutDS() Foundation
Assigns a character string as a date value to a container or produces a new date container.
ContainerHandle _conPutDS(ContainerHandle ch, CHAR pcBuffer[8]);
Returns either the passed container handle or a handle to a new container. The return value is NULLCONTAINER if an error occurrs.
_conPutDS() is used to assign a date value to a container. The date value in the passed buffer must be a character string in the format "YYYYMMDD". This format is independent of the actual system date format setting. The year is formatted with 4 digits, month and day each with two digits with leading zeros (example: 7/22/94 -> "19940722"). Any additional characters in the character string are ignored. If the passed character string is not a valid date, a NULL date is passed to the container.
When the passed container handle has the value NULLCONTAINER, a new date container is created. Otherwise, the date value is assigned to the passed container.
When a new container is created, it must be released with _conRelease() as soon as it is no longer needed.
/*
Produces a new date container.
*/
#include <xppcon.h>
#include <stdio.h>
ContainerHandle hDate;
CHAR buffer[9];
int year = 1994,
month = 7,
day = 29;
XPPAPIRET xr;
sprintf(buffer,"%04%02%02", year, month, day);
hDate = _conPutDS(hDate, buffer);
if (hDate != NULLCONTAINER)
{
/* ... operations with the date container */
_conRelease(hDate);
}
else
{
xr = _conLastError();
/* ... error handling */
}
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.