Skip to main content

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
nk = 1:List built-in functions.
nk = 2:List normal and override user-defined functions.
nk = 4:List external functions (defined by an XOP).
nk = 8:List only curve fitting functions; must be summed with 1, 2, 4, or 16. For example, use 10 to list user-defined fitting functions.
nk = 16:Include static user-defined functions; requires WIN: option, must be summed with 1, 2, or 8. To list only static functions, subtract the non-static functions using RemoveFromList.
NPARAMS:npRestricts the list to functions having exactly np parameters. Omitting this option lists functions having any number of parameters.
NINDVARS:niRestricts 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:nRetRestricts 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:pTypeRestricts 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:rTypeRestricts 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:typeNameLists 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:nvRestricts list to functions whose return type is a certain kind.
nv = 1:Real-valued functions
nv = 2:Complex-valued functions
nv = 4:String functions
nv = 8:WAVE functions
nv = 16:DFREF functions
nv = 32:Multiple Return Syntax functions.
See also RETURN_n_TYPE.
Use a sum of these values to include more than one type. The return type is not restricted if this option is omitted.
WIN:windowTitleLists 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:

TypeCodeCode in Hex
Complex10x1
Single Precision20x2
Variable40x4
Double Precision40x4
Byte80x8
16-bit Integer160x10
32-bit Integer320x20
Unsigned640x40
/WAVE1280x80
Data folder reference2560x100
Structure5120x200
Function reference10240x400
Pass by reference parameter40960x1000
String81920x2000
Wave163840x4000
/Z327680x8000

Special Return Type and Parameter Type Codes

These special codes are used with the PARAM_N_TYPE and RETURN_N_TYPE keywords:

TypeCode
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:

TypeCodeCode in Hex
Any real-valued numeric wave-2
Any complex numeric wave-3
Any text wave-4
Wave/S163860x4000 + 2
Wave or Wave/D163880x4000 + 4
Wave/C or Wave/D/C163890x4000 + 4 + 1
Wave/T163840x4000 + 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.