Core Function FunctionList

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> FunctionList( <expression> ) </pre> === Description === Return an array of all user defined functions (Or just ones fitting a given pattern). ==== expression ==== Optio...")
 
m (1 revision)
 
(2 intermediate revisions by one user not shown)
Line 9: Line 9:
 
==== expression ====
 
==== expression ====
  
Optional; Text to find contained in the function names or a regex to match against the fucntion names.
+
Optional; Text to find contained in the function names or a regex to match against the function names.
  
 
=== Return Value ===
 
=== Return Value ===

Latest revision as of 12:37, 14 June 2015

FunctionList( <expression> )

Contents

Description

Return an array of all user defined functions (Or just ones fitting a given pattern).

expression

Optional; Text to find contained in the function names or a regex to match against the function names.

Return Value

Success: Returns an array of the found functions.

Failure: Returns an empty array.

Remarks

None.

Example

// Define a few user functions
Function moo() { }
Function cat() { }
Function dog() { }
Function fox9() { }
 
// All functions
foreach(FunctionList() as $c)
{
	println("F: " . $c);
}
println("Loop complete\n");
 
// All functions that contain "at"
foreach(FunctionList("at") as $c)
{
	println("F: " . $c);
}
println("Loop complete\n");
 
// All functions that match the regex pattern \w+\d
foreach(FunctionList(m/\w+\d/) as $c)
{
	println("F: " . $c);
}
println("Loop complete\n");
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox