19990831-23:10 GMT+1
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user