Navigation:  ThinBASIC language > Script structure > Functions/Subs >

Function_List

Previous pageReturn to chapter overviewNext page

 

Description

 

Returns the number of functions found in current script.

StringArray variable with the names of the functions.

 

Syntax

 

NumberOfFunctions = Function_List(StringArray [, FunctionsType])

 

Returns

 

Numeric.

The number of functions found.

 

Parameters

 

Name

Type

Optional

Meaning

StringArray

Variable

No

A string array that will be filled with the name of the found functions.

If no functions will be found thsi array will be dimensioned to 1 in any case but returned value will be zero.

FunctionsType

Number

Yes

Type of functions to be returned. Use one of the following equates

%Function_All = all functions

%Function_User = user defined functions (functions written inside the script

%Function_External = external functions declared with DECLARE statement

%Function_TypeMethod = functions defined as type methods.

 

Remarks

 

Restrictions

 

See also

 

Examples

 

String fList() 

Long   nFun

  

nFun = Function_List(fList, %FUNCTION_ALL)

  

MsgBox 0, "In current script there are " & nFun & " functions:" + $CRLF + Join$(fList, $CRLF)

 

Function SomeFunction() As Long

  Return 1

End Function

 

Function SomeOtherFunction() As Long

  Return 2

End Function