hb_PIsByRef()

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()

2 responses to “hb_PIsByRef()

  1. Pingback: Harbour All Functions – H | Viva Clipper !

  2. Pingback: Variable Management Functions | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.