19990831-23:10 GMT+1

This commit is contained in:
Viktor Szakats
1999-08-31 21:53:02 +00:00
parent c9f89973fd
commit c7403f2dd2
3 changed files with 32 additions and 0 deletions

View File

@@ -1,3 +1,10 @@
19990831-23:10 GMT+1 Victor Szel <info@szelvesz.hu>
* source/rtl/itemapi.c
include/itemapi.h
+ hb_itemSetNLen() added to set the numeric values length and number
of decimal places. This way we have a standard way to set these without
fiddling with the internals. Cool.
19990831-22:20 GMT+1 Victor Szel <info@szelvesz.hu>
* source/rtl/hvm.c
! hb_vmFunction() now resets the return value to NIL, since previously

View File

@@ -51,6 +51,7 @@ extern char * hb_itemGetDS ( PHB_ITEM pItem, char *szDate );
extern BOOL hb_itemGetL ( PHB_ITEM pItem );
extern double hb_itemGetND ( PHB_ITEM pItem );
extern long hb_itemGetNL ( PHB_ITEM pItem );
extern void hb_itemSetNLen ( PHB_ITEM pItem, WORD wWidth, WORD wDecimal );
extern PHB_ITEM hb_itemNew ( PHB_ITEM pNull );
extern PHB_ITEM hb_itemParam ( WORD wParam );
extern PHB_ITEM hb_itemPutC ( PHB_ITEM pItem, char *szText );

View File

@@ -386,6 +386,30 @@ PHB_ITEM hb_itemPutNL( PHB_ITEM pItem, long lNumber )
return pItem;
}
void hb_itemSetNLen( PHB_ITEM pItem, WORD wWidth, WORD wDecimal )
{
if( pItem
&& wWidth > 0 && wWidth <= 99
&& ( wDecimal == 0 || wDecimal < ( wWidth - 1 ) ) )
{
switch( pItem->type )
{
case IT_DOUBLE:
pItem->item.asDouble.length = wWidth;
pItem->item.asDouble.decimal = wDecimal;
break;
case IT_LONG:
pItem->item.asLong.length = wWidth;
break;
case IT_INTEGER:
pItem->item.asInteger.length = wWidth;
break;
}
}
}
ULONG hb_itemSize( PHB_ITEM pItem )
{
if( pItem )