HB_ISBYREF()
Inform if the variable is passed by reference.
- Syntax
-
- HB_ISBYREF( @<Var> ) --> <lVarIsByRef>
- Arguments
-
- @<Var> is the variable to test passed by reference.
- Returns
-
- <lVarIsByRef> a logical value indicating if the variable is passed by reference to actual function or procedure.
- Description
-
- This function return a logical value indicating if the variable is passed by reference to actual function or procedure. ATTENTION: The variable to test must be passed by reference. If the variable is not passed by reference, the function return NIL. 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
See Test
Tests
function Main()
local cVar := "Test local"
private nVar := 0
Test( @cVar, @nVar, cVar, nVar )
return nil
procedure Test( Arg1, Arg2, Arg3, Arg4 )
? hb_isbyref( @Arg1 ) // .T.
? hb_isbyref( @Arg2 ) // .T.
? hb_isbyref( @Arg3 ) // .F.
? hb_isbyref( @Arg4 ) // .F.
return
- Status
- Started
- Compliance
-
- HB_ISBYREF() is an extention of Harbour
- Files
-
- Library is rtl
- See Also