FunctionList
FunctionList (matchStr, separatorStr, optionsStr)
The FunctionList function returns a string containing a list of built-in or user-defined function names satisfying certain criteria. This is useful for making a string to list functions in a pop-up menu control. Note that if the procedures need to be compiled, then FunctionList will not list user-defined functions.
Parameters
Only functions having names that match the matchStr string are listed. Use "*" to match all names. See WaveList for examples.
separatorStr is appended to each function name as the output string is generated. separatorStr is usually ";" for list processing (See the Processing Lists of Waves topic in the Programming Techniques help file for details on list processing).
optionsStr is used to further qualify the list of functions. It is a string containing keyword-value pairs separated by commas. Available options are:
| KIND:nk |
| ||||||||||||||
| NPARAMS:np | Restricts the list to functions having exactly np parameters. Omitting this option lists functions having any number of parameters. | ||||||||||||||
| NINDVARS:ni | Restricts the list to fitting functions for exactly ni independent variables. NINDVARS is ignored if you have not elected to list curve fitting functions using the KIND option. Functions for any number of independent variables are listed if the NINDVARS option is omitted. | ||||||||||||||
| NRETURN:nRet | Restricts list to user-defined functions that use the Multiple Return Syntax to return nRet values. | ||||||||||||||
| NRETURN is ignored if KIND:8 is specified. | |||||||||||||||
| NRETURN was added in Igor Pro 9.00. | |||||||||||||||
| PARAM_n_TYPE:pType | Restricts list to functions whose nth input parameter type is a certain kind as described by pType. | ||||||||||||||
| PARAM_n_TYPE is ignored if KIND:8 is specified. | |||||||||||||||
| PARAM_n_TYPE was added in Igor Pro 9.00. | |||||||||||||||
| Use PARAM_0_TYPE for the first parameter, PARAM_1_TYPE for the second parameter, and so on. You can use any number of PARAM_n_TYPE keyword=value pairs in a given FunctionList call. | |||||||||||||||
| For each parameter, set pType to a parameter type code as described under Return Type and Parameter Type Codes below. | |||||||||||||||
| See also Return Type and Parameter Type Code Examples below. | |||||||||||||||
| RETURN_n_TYPE:rType | Restricts list to user-defined functions whose nth Multiple Return Syntax return type is a certain kind described by rType. | ||||||||||||||
| RETURN_n_TYPE is ignored if KIND:8 is specified. | |||||||||||||||
| RETURN_n_TYPE was added in Igor Pro 9.00. | |||||||||||||||
| Use RETURN_0_TYPE for the first return value, RETURN_1_TYPE for the second return value, and so on. You can use any number of RETURN_n_TYPE keyword=value pairs in a given FunctionList call. | |||||||||||||||
| For each return value, set rType to a return type code as described under Return Type and Parameter Type Codes below. | |||||||||||||||
| SUBTYPE:typeName | Lists functions that have the type typeName. That is, you could use ButtonControl as typeName to list only functions that are action procedures for buttons. | ||||||||||||||
| VALTYPE:nv | Restricts list to functions whose return type is a certain kind. | ||||||||||||||
| |||||||||||||||
| Use a sum of these values to include more than one type. The return type is not restricted if this option is omitted. | |||||||||||||||
| WIN:windowTitle | Lists functions that are defined in the procedure window with the given title. "Procedure" is the title of the built-in procedure window. | ||||||||||||||
note Because the optionsStr keyword-value pairs are comma separated and procedure window titles can have commas in them, the WIN: keyword must be the last one specified. | |||||||||||||||
| WIN:windowTitle [independentModuleName ] | |||||||||||||||
| Lists functions that are defined in the named procedure window that belongs to the independent module independentModuleName. See Independent Modules for details. Requires SetIgorOption independentModuleDev=1, otherwise no functions are listed. | |||||||||||||||
| Requires independentModuleName = ProcGlobal or SetIgorOption independentModuleDev=1, otherwise no functions are listed. | |||||||||||||||
note The syntax is literal and strict: the window title must be followed by one space and a left bracket, followed directly by the independent module name and a closing right bracket. | |||||||||||||||
| WIN:[independentModuleName ] | |||||||||||||||
| Lists functions that are defined in any procedure file that belongs to the named independent module. | |||||||||||||||
| Requires independentModuleName = ProcGlobal or SetIgorOption independentModuleDev=1, otherwise no functions are listed. | |||||||||||||||
note The syntax is literal and strict: 'WIN:' must be followed by a left bracket, followed directly by the independent module name and a closing right bracket, like this: | |||||||||||||||
FunctionList(...,"WIN:[myIndependentModuleName]") | |||||||||||||||
Return Type and Parameter Type Codes
These codes are used with the PARAM_N_TYPE and RETURN_N_TYPE keywords:
| Type | Code | Code in Hex |
|---|---|---|
| Complex | 1 | 0x1 |
| Single Precision | 2 | 0x2 |
| Variable | 4 | 0x4 |
| Double Precision | 4 | 0x4 |
| Byte | 8 | 0x8 |
| 16-bit Integer | 16 | 0x10 |
| 32-bit Integer | 32 | 0x20 |
| Unsigned | 64 | 0x40 |
| /WAVE | 128 | 0x80 |
| Data folder reference | 256 | 0x100 |
| Structure | 512 | 0x200 |
| Function reference | 1024 | 0x400 |
| Pass by reference parameter | 4096 | 0x1000 |
| String | 8192 | 0x2000 |
| Wave | 16384 | 0x4000 |
| /Z | 32768 | 0x8000 |
Special Return Type and Parameter Type Codes
These special codes are used with the PARAM_N_TYPE and RETURN_N_TYPE keywords:
| Type | Code |
|---|---|
| Any real-valued numeric wave | -2 |
| Any complex-valued numeric wave | -3 |
| Any text wave | -4 |
| Any WAVE/WAVE | -5 |
| Any WAVE/DF | -6 |
Return Type and Parameter Type Code Examples
This section shows common values used withe PARAM_N_TYPE and RETURN_N_TYPE keywords:
| Type | Code | Code in Hex | |
|---|---|---|---|
| Any real-valued numeric wave | -2 | ||
| Any complex numeric wave | -3 | ||
| Any text wave | -4 | ||
| Wave/S | 16386 | 0x4000 + 2 | |
| Wave or Wave/D | 16388 | 0x4000 + 4 | |
| Wave/C or Wave/D/C | 16389 | 0x4000 + 4 + 1 | |
| Wave/T | 16384 | 0x4000 + 0 | |
If /Z is used, add 32768 or 0x8000.
For pass-by-reference parameters, add 4096 or 0x1000.
To list user-defined functions in the main procedure window that have either a Wave or Wave/D first parameter, with or without /Z:
Print FunctionList("*",";","KIND:2,PARAM_0_TYPE:-2,WIN:Procedure") // WIN must be last option
Examples
To list user-defined fitting functions for two independent variables:
Print FunctionList("*",";","KIND:10,NINDVARS:2")
To list button-control functions that start with the letter "b" (note that button-control functions are user-defined):
Print FunctionList("b*",";","KIND:2,SUBTYPE:ButtonControl")
See Also
DisplayProcedure, FunctionInfo, Independent Modules, MacroList, Multiple Return Syntax, OperationList, Procedure Subtypes, StringFromList, WinList.