# Adding Subprogram node in Java

**URL:** <https://forum.universal-robots.com/t/adding-subprogram-node-in-java/10542>\
**Category:** Java\
**Created:** [December 4, 2020, 9:41pm UTC](https://forum.universal-robots.com/t/adding-subprogram-node-in-java/10542 "2020-12-04T21:41:31Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![sam.verity-hilton](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/sam.verity-hilton/32/6046_2.png) [@sam.verity-hilton](https://forum.universal-robots.com/u/sam.verity-hilton)\
**Post date:** [December 8, 2020, 10:37am UTC](https://forum.universal-robots.com/t/adding-subprogram-node-in-java/10542/4 "2020-12-08T10:37:49Z")

</div>

Regarding reading in a script file, you will need to feed it in line by line rather than parsing the whole thing in one go. Fortunately Jacob from UR has made a sample which does exactly this, just pinch what you need from the following sample.

> [@URCap Sample: Script Wrapper URCap](https://forum.universal-robots.com/t/sample-script-wrapper-urcap/1196):
>
> Script Wapper URCap Description of functionality: This URCap wraps the contents of a selected script file into a program node in PolyScope. The user can select which script file to wrap, and select a decent image to show instead. User must place a script file (.script) and optionally image (.jpg, .jpeg, .png .bmp) in the /programs/ folder on a real robot, or /home/ur/ursim-current/programs/ in a URSim. The URCap checks the robots serial number, to decide what folder to look in. The sample d…

---

_[View the full topic](https://forum.universal-robots.com/t/adding-subprogram-node-in-java/10542)._
