# Call subprog with string

**URL:** <https://forum.universal-robots.com/t/call-subprog-with-string/24709>\
**Category:** URScript\
**Created:** [October 30, 2022, 1:04pm UTC](https://forum.universal-robots.com/t/call-subprog-with-string/24709 "2022-10-30T13:04:38Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![m.hammerton](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@m.hammerton](https://forum.universal-robots.com/u/m.hammerton)\
**Post date:** [October 31, 2022, 7:55am UTC](https://forum.universal-robots.com/t/call-subprog-with-string/24709/2 "2022-10-31T07:55:11Z")

</div>

Elettrotec\_AC14,  
I don’t think its possible because of the way the Program gets compiled when you save it.

When a Sub program is added into an Main program it gets incorporated into one file when saved.  
(If you look at the txt file that gets created when you save a program you’ll see all the lines of code for your sub program too)!!  
You would have to have a Case for each program and call the sub program like that.  
This of course makes the program Massive if you have lots of sub programs you may want to call. which may cause the Robot controller to slowdown or even fall over.

(Its probably the most annoying feature with the UR Robot)

I’ve already created a wish list pos for this feature

> [@Separation of Sub programs from the main program](https://forum.universal-robots.com/t/separation-of-sub-programs-from-the-main-program/18684):
>
> Summary Sub programs currently get integrated into the main program. Having a large amount of sub programs integrated into the main program make the whole program very large. This has the effect of making the robot struggle to process all the necessary commands. It also makes the program script difficult to read. What is it? I would like to have them separate. Why is it needed? I have a Main program that calls individual sub programs based on some variables. to do different tasks. the pro…

---

_[View the full topic](https://forum.universal-robots.com/t/call-subprog-with-string/24709)._
