Core Function ClassList
From Sputnik Wiki
ClassList( <expression> )
Contents |
Description
Return an array of all user defined classes (Or just ones fitting a given pattern).
expression
Optional; Text to find contained in the class names or a regex to match against the class names.
Return Value
Success: Returns an array of the found classes.
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");