<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://hotline.ubersoft.org/Sputnik/wiki/skins/common/feed.css?301"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
		<id>http://hotline.ubersoft.org/Sputnik/wiki/index.php?action=history&amp;feed=atom&amp;title=Core_Function_Function_Variables</id>
		<title>Core Function Function Variables - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://hotline.ubersoft.org/Sputnik/wiki/index.php?action=history&amp;feed=atom&amp;title=Core_Function_Function_Variables"/>
		<link rel="alternate" type="text/html" href="http://hotline.ubersoft.org/Sputnik/wiki/index.php?title=Core_Function_Function_Variables&amp;action=history"/>
		<updated>2026-05-13T22:24:42Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.17.0</generator>

	<entry>
		<id>http://hotline.ubersoft.org/Sputnik/wiki/index.php?title=Core_Function_Function_Variables&amp;diff=4990&amp;oldid=prev</id>
		<title>UberFoX: 2 revisions</title>
		<link rel="alternate" type="text/html" href="http://hotline.ubersoft.org/Sputnik/wiki/index.php?title=Core_Function_Function_Variables&amp;diff=4990&amp;oldid=prev"/>
				<updated>2015-06-14T12:37:52Z</updated>
		
		<summary type="html">&lt;p&gt;2 revisions&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 12:37, 14 June 2015&lt;/td&gt;
		&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>UberFoX</name></author>	</entry>

	<entry>
		<id>http://hotline.ubersoft.org/Sputnik/wiki/index.php?title=Core_Function_Function_Variables&amp;diff=4989&amp;oldid=prev</id>
		<title>UberFoX: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://hotline.ubersoft.org/Sputnik/wiki/index.php?title=Core_Function_Function_Variables&amp;diff=4989&amp;oldid=prev"/>
				<updated>2014-11-29T01:03:58Z</updated>
		
		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 01:03, 29 November 2014&lt;/td&gt;
		&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>UberFoX</name></author>	</entry>

	<entry>
		<id>http://hotline.ubersoft.org/Sputnik/wiki/index.php?title=Core_Function_Function_Variables&amp;diff=4988&amp;oldid=prev</id>
		<title>UberFoX: Created page with &quot;&lt;pre&gt; $var = function(&lt;args&gt;){&lt;stmList&gt;}; $var(&lt;params&gt;); &lt;/pre&gt;  === Description ===  Dynamically create function source code and place it in a variable and call it from the...&quot;</title>
		<link rel="alternate" type="text/html" href="http://hotline.ubersoft.org/Sputnik/wiki/index.php?title=Core_Function_Function_Variables&amp;diff=4988&amp;oldid=prev"/>
				<updated>2014-08-14T13:08:13Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; $var = function(&amp;lt;args&amp;gt;){&amp;lt;stmList&amp;gt;}; $var(&amp;lt;params&amp;gt;); &amp;lt;/pre&amp;gt;  === Description ===  Dynamically create function source code and place it in a variable and call it from the...&amp;quot;&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 13:08, 14 August 2014&lt;/td&gt;
		&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>UberFoX</name></author>	</entry>

	<entry>
		<id>http://hotline.ubersoft.org/Sputnik/wiki/index.php?title=Core_Function_Function_Variables&amp;diff=4233&amp;oldid=prev</id>
		<title>UberFoX: Created page with &quot;&lt;pre&gt; $var = function(&lt;args&gt;){&lt;stmList&gt;}; $var(&lt;params&gt;); &lt;/pre&gt;  === Description ===  Dynamically create function source code and place it in a variable and call it from the var...&quot;</title>
		<link rel="alternate" type="text/html" href="http://hotline.ubersoft.org/Sputnik/wiki/index.php?title=Core_Function_Function_Variables&amp;diff=4233&amp;oldid=prev"/>
				<updated>2014-08-14T13:07:16Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; $var = function(&amp;lt;args&amp;gt;){&amp;lt;stmList&amp;gt;}; $var(&amp;lt;params&amp;gt;); &amp;lt;/pre&amp;gt;  === Description ===  Dynamically create function source code and place it in a variable and call it from the var...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
$var = function(&amp;lt;args&amp;gt;){&amp;lt;stmList&amp;gt;};&lt;br /&gt;
$var(&amp;lt;params&amp;gt;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
Dynamically create function source code and place it in a variable and call it from the variable &lt;br /&gt;
&lt;br /&gt;
=== $var===&lt;br /&gt;
&lt;br /&gt;
The variable to place the function or call the function from.&lt;br /&gt;
&lt;br /&gt;
=== args ===&lt;br /&gt;
&lt;br /&gt;
The functions arguments&lt;br /&gt;
&lt;br /&gt;
=== stmList ===&lt;br /&gt;
&lt;br /&gt;
A list of statements to execute inside the function&lt;br /&gt;
&lt;br /&gt;
=== params ===&lt;br /&gt;
&lt;br /&gt;
Parameters to use when calling the function&lt;br /&gt;
&lt;br /&gt;
=== Return Value ===&lt;br /&gt;
&lt;br /&gt;
Depends what the function returns.&lt;br /&gt;
&lt;br /&gt;
=== Remarks ===&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
Basic example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sputnik&amp;quot;&amp;gt;&lt;br /&gt;
my $Func =  Function(){ println(&amp;quot;Hello&amp;quot;); };&lt;br /&gt;
$Func();&lt;br /&gt;
// Prints&lt;br /&gt;
// Hello&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This time with some params&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sputnik&amp;quot;&amp;gt;&lt;br /&gt;
my $Func =  Function( $a, $b ){ println(&amp;quot;Value is: &amp;quot; . ($a + $b)); };&lt;br /&gt;
$Func(10, 20);&lt;br /&gt;
// Prints&lt;br /&gt;
// Value is: 30&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using an array&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sputnik&amp;quot;&amp;gt;&lt;br /&gt;
my $FuncArray = array();&lt;br /&gt;
$FuncArray[] = Function(){ println(&amp;quot;Hello&amp;quot;); };&lt;br /&gt;
$FuncArray[] = Function(){ println(&amp;quot;Test&amp;quot;); };&lt;br /&gt;
$FuncArray[] = Function(){ println(&amp;quot;Cat&amp;quot;); };&lt;br /&gt;
&lt;br /&gt;
foreach($FuncArray as $f)&lt;br /&gt;
{&lt;br /&gt;
	$f(); // Call it&lt;br /&gt;
}&lt;br /&gt;
// Prints&lt;br /&gt;
// Hello&lt;br /&gt;
// Test&lt;br /&gt;
// Cat&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the @Args variable for infinite paramters&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sputnik&amp;quot;&amp;gt;&lt;br /&gt;
my $Func =  [Args(&amp;quot;true&amp;quot;)]Function(){ printr @Args; };&lt;br /&gt;
$Func(1, 3, 8, &amp;quot;Hi&amp;quot;);&lt;br /&gt;
// Prints&lt;br /&gt;
// Array&lt;br /&gt;
// (&lt;br /&gt;
//     [0] =&amp;gt; 1&lt;br /&gt;
//     [1] =&amp;gt; 3&lt;br /&gt;
//     [2] =&amp;gt; 8&lt;br /&gt;
//     [3] =&amp;gt; Hi&lt;br /&gt;
// )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course it doesn't have to be on one line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sputnik&amp;quot;&amp;gt;&lt;br /&gt;
my $Func =&lt;br /&gt;
[Args(&amp;quot;true&amp;quot;)]&lt;br /&gt;
Function()&lt;br /&gt;
{&lt;br /&gt;
	$count = count(@Args);&lt;br /&gt;
	say &amp;quot;There are $count param(s)&amp;quot;;&lt;br /&gt;
	printr @Args;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$Func(1, 3, 8, &amp;quot;Hi&amp;quot;);&lt;br /&gt;
// Prints&lt;br /&gt;
// There are 4 param(s)&lt;br /&gt;
// Array&lt;br /&gt;
// (&lt;br /&gt;
//     [0] =&amp;gt; 1&lt;br /&gt;
//     [1] =&amp;gt; 3&lt;br /&gt;
//     [2] =&amp;gt; 8&lt;br /&gt;
//     [3] =&amp;gt; Hi&lt;br /&gt;
// )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Core Function]]&lt;/div&gt;</summary>
		<author><name>UberFoX</name></author>	</entry>

	</feed>