Item

ItemPutD

Put a date into a value

Syntax

Signature
ITEM *ItemPutD( ITEM *item, int date );

Arguments

item Value to replace, or NULL to allocate a new ITEM.

date Date encoded as the integer YYYYMMDD, for example 20261201.

Return value

The destination. If item was NULL, release the new value with ItemRelease().

Description

The date is an integer yyyymmdd, as Date() and CToD() return it; 0 is an empty date.

Example

itemputd.c
#include "xdev-wtui.h"

#include <stdio.h>

int main( void )
{
   ITEM *item = ItemNew( NULL );

   if( !item )
      return 1;

   ItemPutD( item, 19901010 );
   printf( "%s\n", DToS( ItemGetD( item ) ) );
   ItemRelease( item );

   return 0;
}