Function : Item (Field)

NSFItemTimeCompare - Compare TYPE_TIME item value to a TIMEDATE.
----------------------------------------------------------------------------------------------------------

#include <nsfnote.h>

BOOL LNPUBLIC NSFItemTimeCompare(
NOTEHANDLE note_handle,
const char far *item_name,
const TIMEDATE far *td_item_ptr,
int far *result_ptr);

Description :

This function takes a handle to an open note, the name for the TYPE_TIME Item whose value you wish to compare, the TIMEDATE value to be used in the comparison. It returns a value that indicates the result of the comparison: -1 means the specified TIMEDATE value to be used in the comparison is older, 0 means they are equal, and 1 means the specified TIMEDATE value to be used in the comparison is later.

Parameters :

Sample Usage :

/* Compare time in Note to current time */

OSCurrentTIMEDATE(&current_td);
printf("Can TIMEDATE in Note be equal to current TIMEDATE?\n");
if (NSFItemIsPresent(note1_handle, TIME_ITEM, strlen(TIME_ITEM)))
{
  NSFItemTimeCompare(note1_handle, TIME_ITEM,
                        &current_td, &answer);
  if (answer == 0)
     printf("Answer: %s\n", "YES YES YES!");
  else if(answer != 0)
     printf("Answer: %s\n", "Nooooooooo!");
}


See Also :

NSFItemGetTime
----------------------------------------------------------------------------------------------------------