hb_PIsByRef()
Determine if a parameter is passed by reference.
Syntax
hb_PIsByRef( nParam ) --> <lParamIsByRef>
Arguments
<nParam> is the parameter number to test.
Returns
<lVarIsByRef> a logical value indicating if the parameter is passed by reference to actual function or procedure.
Description
This function return a logical value indicating if the parameter is passed by reference to actual function or procedure.
This function is based on the form that Harbour manages to the variables for reference. When a variable is passed by reference, what receives the function or procedure is, a pointer to the previous variable, be this the container variable of the data or a pointer to another variable. The function observes if the variable passed points to a common variable or to a variable passed by reference.
Examples
PROCEDURE Main() LOCAL cVar := "Test local" MEMVAR m_nVar PRIVATE m_nVar := 0 Test( @cVar, @m_nVar, cVar, m_nVar ) RETURN STATIC PROCEDURE Test( Arg1, Arg2, Arg3, Arg4 ) ? hb_PIsByRef( 1 ) // .T. ? hb_PIsByRef( 2 ) // .T. ? hb_PIsByRef( 3 ) // .F. ? hb_PIsByRef( 4 ) // .F. RETURN
Compliance
Harbour
Files
Library is core
Seealso
ValType()
Pingback: Harbour All Functions – H | Viva Clipper !
Pingback: Variable Management Functions | Viva Clipper !