Item

ArrayGetD

Return the date of an array element

Syntax

Signature
int ArrayGetD( const ITEM *array, size_t index );

Arguments

array Array to access.

index Element position, counted from 1.

Return value

The stored YYYYMMDD date, or 0 for a missing element or a different type.

Description

Reads an IT_DATE value. Use ArraySetD() to store a date and DToC() to format it for display.

Example

arraygetd.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;
}