source/rtl/valtype.c

+ Add function: IS_VARBYREF( ).
       This function allows in PRGs to know if a parameter has been passed
       by value or by reference.
This commit is contained in:
Walter Negro
2002-04-14 04:47:43 +00:00
parent 6fd6174039
commit c1792f85a2

View File

@@ -50,11 +50,49 @@
*
*/
/*
* The following parts are Copyright of the individual authors.
* www - http://www.harbour-project.org
*
* Copyright 2002 Walter Negro <anegro@overnet.com.ar>
* 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( );
}
}