xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HB_IsByRef

Tests if a parameter is passed by reference.

Syntax

HB_IsByRef( @<variable> ) --> lIsByReference

Arguments

@<variable>
<variable> is the symbolic name of any parameter passed to a function, method or procedure.

Return

The function returns .T. (true) if the variable <variable> is passed by reference, otherwise .F. (false) is returned.

Description

Function HB_IsByRef() is used to test if a variable is passed by reference to a function, method or procedure. This requires to pass <variable> by reference to HB_IsByRef(). If <variable> is not passed by reference to HB_IsByRef(), a runtime error is raised.

Info

See also:HB_IsArray(), HB_IsBlock(), HB_IsDate(), HB_IsHash(), HB_IsLogical(), HB_IsMemo(), HB_IsNIL(), HB_IsNull(), HB_IsNumeric(), HB_IsObject(), HB_IsPointer(), HB_IsString(), Type(), Valtype()
Category: Debug functions , Logical functions , xHarbour extensions
Source:rtl\valtype.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example demonstrates how to test if a variable is
// passed by reference to a subroutine.

   PROCEDURE Main
      LOCAL cMsg := "Hello World"
      LOCAL dDate:= Date()

      Test( cMsg, @dDate )
   RETURN

   PROCEDURE Test( p1, p2 )
      ? "First parameter is "

      IF HB_IsByRef( @p1 )
         ?? "passed by reference"
      ELSE
         ?? "not passed by reference"
      ENDIF

      ? "Second parameter is "

      IF HB_IsByRef( @p2 )
         ?? "passed by reference"
      ELSE
         ?? "not passed by reference"
      ENDIF
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe