# Which scope is my code running in?

**URL:** <https://forum.inductiveautomation.com/t/which-scope-is-my-code-running-in/15540>\
**Category:** Ignition\
**Created:** [October 2, 2017, 11:11pm UTC](https://forum.inductiveautomation.com/t/which-scope-is-my-code-running-in/15540 "2017-10-02T23:11:25Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [October 2, 2017, 11:37pm UTC](https://forum.inductiveautomation.com/t/which-scope-is-my-code-running-in/15540/3 "2017-10-02T23:37:27Z")

</div>

This would also work, but I like Kevin’s solution.

```auto
def getLocation():
	try:
		if system.util.getSystemFlags() & system.util.CLIENT_FLAG:
			location = 1
		elif system.util.getSystemFlags() & system.util.DESIGNER_FLAG:
			location = 2
	except:
		location = 0
	return location

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/which-scope-is-my-code-running-in/15540)._
