Item

ArraySetD

Put a date into an array element

Syntax

Signature
int ArraySetD( ITEM *array, size_t index, int date );

Arguments

array Array to access.

index Element position, counted from 1.

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

Return value

1; 0 outside the array. The index counts from 1.

Description

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

Example

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

#include <stdio.h>

int main( void )
{
   ITEM *array = Array( 2 );

   if( !array )
      return 1;

   ArraySetD( array, 1, 19901010 );
   printf( "%s\n", DToS( ArrayGetD( array, 1 ) ) );
   ItemRelease( array );

   return 0;
}