diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 1ba040d38a..9a3d67fdeb 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,10 @@ +20000413-02:14 GMT+1 Victor Szakats + + * include/hbapiitm.h + * source/vm/itemapi.c + * source/vm/extend.c + + hb_itemPutD() added. hb_retd() modified to call this. + 20000412-11:01 GMT+1 Victor Szakats * include/hbdate.h diff --git a/harbour/include/hbapiitm.h b/harbour/include/hbapiitm.h index fc15e147fe..bd0656299e 100644 --- a/harbour/include/hbapiitm.h +++ b/harbour/include/hbapiitm.h @@ -81,6 +81,7 @@ extern PHB_ITEM hb_itemPutC ( PHB_ITEM pItem, char * szText ); extern PHB_ITEM hb_itemPutCPtr ( PHB_ITEM pItem, char * szText, ULONG ulLen ); extern PHB_ITEM hb_itemPutCL ( PHB_ITEM pItem, char * szText, ULONG ulLen ); extern void hb_itemSetCMemo ( PHB_ITEM pItem ); +extern PHB_ITEM hb_itemPutD ( PHB_ITEM pItem, long lYear, long lMonth, long lDay ); extern PHB_ITEM hb_itemPutDS ( PHB_ITEM pItem, char * szDate ); extern PHB_ITEM hb_itemPutDL ( PHB_ITEM pItem, long lJulian ); extern PHB_ITEM hb_itemPutL ( PHB_ITEM pItem, BOOL bValue ); diff --git a/harbour/source/vm/extend.c b/harbour/source/vm/extend.c index 1be291fa01..4222cd8827 100644 --- a/harbour/source/vm/extend.c +++ b/harbour/source/vm/extend.c @@ -495,7 +495,7 @@ void hb_retd( long lYear, long lMonth, long lDay ) { HB_TRACE(HB_TR_DEBUG, ("hb_retd(%04i, %02i, %02i)", lYear, lMonth, lDay)); - hb_itemPutDL( &hb_stack.Return, hb_dateEncode( lYear, lMonth, lDay ) ); + hb_itemPutD( &hb_stack.Return, lYear, lMonth, lDay ); } void hb_retl( int iLogical ) diff --git a/harbour/source/vm/itemapi.c b/harbour/source/vm/itemapi.c index 84bd93a9da..3970f985cf 100644 --- a/harbour/source/vm/itemapi.c +++ b/harbour/source/vm/itemapi.c @@ -54,6 +54,7 @@ * hb_itemPutNDLen() * hb_itemPutNILen() * hb_itemPutNLLen() + * hb_itemPutD() * hb_itemSetCMemo() * * Copyright 1999 Eddie Runia @@ -711,6 +712,21 @@ PHB_ITEM hb_itemPutDS( PHB_ITEM pItem, char * szDate ) return pItem; } +PHB_ITEM hb_itemPutD( PHB_ITEM pItem, long lYear, long lMonth, long lDay ) +{ + HB_TRACE(HB_TR_DEBUG, ("hb_itemPutD(%p, %04i, %02i, %02i)", pItem, lYear, lMonth, lDay)); + + if( pItem ) + hb_itemClear( pItem ); + else + pItem = hb_itemNew( NULL ); + + pItem->type = HB_IT_DATE; + pItem->item.asDate.value = hb_dateEncode( lYear, lMonth, lDay ); + + return pItem; +} + PHB_ITEM hb_itemPutDL( PHB_ITEM pItem, long lJulian ) { HB_TRACE(HB_TR_DEBUG, ("hb_itemPutDL(%p, %ld)", pItem, lJulian));