diff --git a/harbour/source/rtl/valtype.c b/harbour/source/rtl/valtype.c index 5eee316fd8..ee35af1b99 100644 --- a/harbour/source/rtl/valtype.c +++ b/harbour/source/rtl/valtype.c @@ -50,11 +50,49 @@ * */ +/* + * The following parts are Copyright of the individual authors. + * www - http://www.harbour-project.org + * + * Copyright 2002 Walter Negro + * IS_VARBYREF() + * + * See doc/license.txt for licensing terms. + * + */ + + #include "hbapi.h" #include "hbapiitm.h" +#include "hbstack.h" HB_FUNC( VALTYPE ) { hb_retc( hb_itemTypeStr( hb_param( 1, HB_IT_ANY ) ) ); } +HB_FUNC( IS_VARBYREF ) +{ + PHB_ITEM pItem; + + if( hb_pcount() ) + { + pItem = hb_stackItemFromBase( 1 ); + + if( pItem->type & HB_IT_BYREF ) + { + pItem = hb_itemUnRefOnce( pItem ); + + if( pItem->type & HB_IT_BYREF ) + + hb_retl( TRUE ); + + else + + hb_retl( FALSE ); + } + else + hb_ret( ); + } +} +