Core Function Keys

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> Keys( <array> ) </pre> === Description === Create an array containing all KEYS from a Hash (Dictionary) === Parameters === ==== array ==== The array to use. === Retur...")
 
m (1 revision)
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
 
<pre>
 
<pre>
Keys( <array> )
+
Keys( <array>, <flag> )
 
</pre>
 
</pre>
  
Line 12: Line 12:
  
 
The array to use.
 
The array to use.
 +
 +
==== flag ====
 +
 +
Limiter
 +
 +
<pre>
 +
0 = Return all keys (default)
 +
1 = Return all hash keys (strings only)
 +
2 = Return all array keys (numeric only)
 +
</pre>
  
 
=== Return Value ===
 
=== Return Value ===

Latest revision as of 12:37, 14 June 2015

Keys( <array>, <flag> )

Contents

Description

Create an array containing all KEYS from a Hash (Dictionary)

Parameters

array

The array to use.

flag

Limiter

0 = Return all keys (default)
1 = Return all hash keys (strings only)
2 = Return all array keys (numeric only)

Return Value

Success: A new array containing any/all keys.

Failure: Returns empty array.

Remarks

None.

Example

my $array = array( "One" => "Cat", "Two" => "Fire", "Three" => "FoX", "Four" => "Water" );
my $Keys = Keys( $array );
foreach( $Keys as $Key )
{
	println( "Key: $Key" );
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox