Core Function List

From Sputnik Wiki
Revision as of 13:21, 28 January 2013 by UberFoX (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
<Scope> List( <expressions>, .. ) = <array>

Contents

Description

Extract some elements from an array into ready to use variables .

Scope

Optional; Can be nothing or can be "my" (without quotes)

expressions

A list of variables to be created separated by ,

array

The array to use

Return Value

None

Remarks

If the scope is set to "my" then the newly created variables will be local scope only otherwise it may even modify globals.

Example

my $Accounts = array();
$Accounts[] = array("John", 1111);
$Accounts[] = array("Smith", 2222);
 
foreach($Accounts as my $Account)
{
	my List( $Name, $Password ) = $Account;
	println( "Name '$Name' Password '$Password'" );
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox