# Printing the name of the function and who called it?

**URL:** <https://forum.inductiveautomation.com/t/printing-the-name-of-the-function-and-who-called-it/37910>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [August 19, 2020, 1:42pm UTC](https://forum.inductiveautomation.com/t/printing-the-name-of-the-function-and-who-called-it/37910 "2020-08-19T13:42:31Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [June 28, 2022, 8:04pm UTC](https://forum.inductiveautomation.com/t/printing-the-name-of-the-function-and-who-called-it/37910/13 "2022-06-28T20:04:46Z")

</div>

The biggest reason is to avoid legacy scoping rules. If you search the forum you can find tons of examples of the different ways in which legacy scoping creates issues.

To sum things up succinctly:

> [@Gateway timer script - calling a function within a function - global not defined error](https://forum.inductiveautomation.com/t/gateway-timer-script-calling-a-function-within-a-function-global-not-defined-error/39313/2):
>
> Gateway level, project-scoped (gateway timer, tag change etc) scripts, for complicated legacy reasons, follow legacy scoping rules.
> 
> Generally speaking, the easiest, most maintainable thing to do is _immediately_ bail out of your gateway timer script to a function defined in a real project script, and have all of your logic there. Besides modern scoping, you also get the benefit of true diffing of project changes if it’s in a project script.

---

_[View the full topic](https://forum.inductiveautomation.com/t/printing-the-name-of-the-function-and-who-called-it/37910)._
