I've found that XTOC( 2007 ) returns garbage and that LASTDAYOM
returns 0 without parameters while the doc says it should use the
system date.

For XTOC there is warning that says:

     ATTENTION: different implementations or platforms of Harbour, they
 *      could produce different format in the string returned by XTOC() for
 *      data type NUMBER.

Is there anybody with CT installed that can confirm the differences?

function main

? "LASTDAYOM", LASTDAYOM()
? "XTOC", XTOC( 2007 )

return nil


best regards,
Lorenzo

P.S. I've fixed locally LASTDAYOM in this way:

HB_FUNC( LASTDAYOM )
{
   BOOL bLeap = 0;
   int iYear, iMonth, iDay;

   if( ISDATE( 1 ) )
   {
      PHB_ITEM pDate = hb_param( 1, HB_IT_DATE );
      LONG lDate = hb_itemGetDL( pDate );

      if( lDate )
      {
         hb_dateDecode( lDate, &iYear, &iMonth, &iDay );
      }
      else
      {
         hb_dateToday( &iYear, &iMonth, &iDay );
      }
      bLeap = ct_isleap( iYear );
   }
   else if( ISNUM( 1 ) )
   {
      iMonth = hb_parni( 1 );
   }
   else if( ISNIL( 1 ) )
          // <---- added this
   {
           hb_dateToday( &iYear, &iMonth, &iDay );
   }
               // <--------------------
   else
   {
      iMonth = 0;
   }

   hb_retni( ( iMonth && ( iMonth <= 12 ) ? ct_daysinmonth( iMonth,
bLeap ) : 0 ) );

}
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to