Constant

CurrentMethodName


Description

Contains the fully-qualified name of the method or event that it is in.

Usage

result = CurrentMethodName

Part

Type

Description

result

String

The name of the method or event that contains the constant.

Notes

Returns String.

You can use this for logging purposes to identify methods that were called and code that was run.

The CurrentMethodName constant automatically contains the fully-qualified name of the method or event that contains the constant. It is equivalent to a manual declaration such as

Const CurrentMethodName = "methodName"

Where methodName is the fully-qualified name. For example, if you create a method on Window1, "MyMethod," then CurrentMethodName will equal "Window1.MyMethod".

Sample code

This logs the method name when it runs:

System.DebugLog("MyApp: " + CurrentMethodName)

Compatibility

All project types on all supported operating systems.

See also

Sub, Function statements.