Core Function Ref

From Sputnik Wiki
Revision as of 12:37, 14 June 2015 by UberFoX (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Ref( $variable )

Contents

Description

Retrieve the variable at the lowest depth in references that the current variable links to

Parameters

$variable

A variable to locate and return its ref.

(If the variable links to a ref that links to a ref that links to a ref it will return the last one it finds at the end of the chain assuming the chain does end... )

Return Value

None

Remarks

None.

Example

$a = qw(The quick brown fox);
$b = &$a;
println( isVarRef(      $b   ) ? "true" : "false" );
println( isVarRef(  Ref($b)  ) ? "true" : "false" );

The * operator can also be used as if Ref() was used example :

$a = qw(The quick brown fox);
$b = &$a;
println( isVarRef(      $b   ) ? "true" : "false" );
println( isVarRef(     *$b   ) ? "true" : "false" );
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox