Core Function FunctionList

From Sputnik Wiki
Jump to: navigation, search
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