# Stack Pointer Question

**URL:** <https://forum.universal-robots.com/t/stack-pointer-question/20113>\
**Category:** URScript\
**Created:** [March 24, 2022, 3:06pm UTC](https://forum.universal-robots.com/t/stack-pointer-question/20113 "2022-03-24T15:06:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon39314409](https://avatars.discourse-cdn.com/v4/letter/a/f9ae1b/32.png) [@anon39314409](https://forum.universal-robots.com/u/anon39314409)\
**Post date:** [March 24, 2022, 3:06pm UTC](https://forum.universal-robots.com/t/stack-pointer-question/20113/1 "2022-03-24T15:06:50Z")

</div>

Good evening,

I wanted to know if the UR3e polyscope offers some type of stack pointer and a “go to” command to be able to navigate through the code.

Thank you for your time.

---

<div class="post-metadata">

**Author:** ![anon9854431](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@anon9854431](https://forum.universal-robots.com/u/anon9854431)\
**Post date:** [March 24, 2022, 5:05pm UTC](https://forum.universal-robots.com/t/stack-pointer-question/20113/2 "2022-03-24T17:05:02Z")

</div>

I’m new to UR myself, but from what I learned up till now, if there is a stack pointer (I’m sure there is one) it’s hidden from the programmer and there is no goto. Doesn’t one of the other control structures do for you, like SubProg (gosub :-)) for example?

---

<div class="post-metadata">

**Author:** ![anon39314409](https://avatars.discourse-cdn.com/v4/letter/a/f9ae1b/32.png) [@anon39314409](https://forum.universal-robots.com/u/anon39314409)\
**Post date:** [March 24, 2022, 7:30pm UTC](https://forum.universal-robots.com/t/stack-pointer-question/20113/3 "2022-03-24T19:30:30Z")

</div>

Hello,  
I want to be able to track my position so that after leaving an inner loop suddenly I can go back to where I left off without having to restart the entire program.  
Thank you for your time!

---

<div class="post-metadata">

**Author:** ![anon9854431](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@anon9854431](https://forum.universal-robots.com/u/anon9854431)\
**Post date:** [March 28, 2022, 12:49pm UTC](https://forum.universal-robots.com/t/stack-pointer-question/20113/4 "2022-03-28T12:49:29Z")

</div>

Isn’t that, what sub-programs are used for?

---

<div class="post-metadata">

**Author:** ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)\
**Post date:** [March 28, 2022, 1:07pm UTC](https://forum.universal-robots.com/t/stack-pointer-question/20113/5 "2022-03-28T13:07:09Z")

</div>

Take a look at this post:

> [@Jump Flag Program Node](https://forum.universal-robots.com/t/jump-flag-program-node/17355/4):
>
> [image] This might be closer to the behavior you are looking for then. Essentially, the subprograms label1 and label2 are your “Label” instructions and the script lines “lable1()” and “label2()” are your Jump instructions. These can be called from within each other as well. To insert a subprogram without the “Call” instruction, first select the main “Robot Program” line and then click “SubProg” from the left panel. Then just rename it to whatever you want to type in to jump there.

You can use this as a sort of “go to/label” method. This gets around the limitation of being unable to call a subprogram from inside a subprogram as well.
