Core Function Enumerate

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
UberFoX (Talk | contribs)
(Created page with "<pre> Enumerate( <enum> ) </pre> === Description === Cycle through all Name + Values in an enum === Parameters === ==== enum ==== The enum to use. === Return Value === Suc...")
Newer edit →

Revision as of 08:24, 26 March 2012

Enumerate( <enum> )

Contents

Description

Cycle through all Name + Values in an enum

Parameters

enum

The enum to use.

Return Value

Success: A hash containing Key/Values matching the Enums.

Failure: Returns nothing.

Remarks

None.

Example

enum Countries
{
	$England = 1,
	$France = 2,
	$Germany = 3,
	$Netherlands = 4,
	$Italy = 6,
	$Soviet = 7
};
 
foreach( Enumerate("Countries") as $Country <=> $ID )
{
	println("Enum item Name '$Country' Value '$ID'");
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox