Constant

# CurrentMethodName

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

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

## Usage

``` xojo
result = CurrentMethodName
```

| Part   | Type                             | Description                                                 |
|--------|----------------------------------|-------------------------------------------------------------|
| result | `String</api/data_types/string>` | The name of the method or event that contains the constant. |

## Notes

Returns `String</api/data_types/string>`.

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

The <span class="title-ref">CurrentMethodName</span> 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

``` xojo
Const CurrentMethodName = "methodName"
```

Where methodName is the fully-qualified name. For example, if you create a method on Window1, "MyMethod," then <span class="title-ref">CurrentMethodName</span> will equal "Window1.MyMethod".

## Sample code

This logs the method name when it runs:

``` xojo
System.DebugLog("MyApp: " + CurrentMethodName)
```

## Compatibility

|                       |     |
|-----------------------|-----|
| **Project Types**     | All |
| **Operating Systems** | All |

<div class="seealso">

`Sub</api/language/sub>`, `Function</api/language/function>` statements.

</div>
