> For the complete documentation index, see [llms.txt](https://hyundai-robotics.gitbook.io/hi6-robot-language/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hyundai-robotics.gitbook.io/hi6-robot-language/rl-english/flowcontrol-subprogram/call-jump/param-return.md).

# 3.7.2 Parameters and param, return

In a job program, formal parameters are used as channels through which input and output are passed. The **param** statement will define formal parameters at the beginning of the job program.

In the following example, job no. 105 is named as "dist2d,” as it is a subjob that acquires the Euclidean distance from the origin to the coordinate value (x, y) and returns it to len.

|          |            |
| -------- | ---------- |
| 0001.job | <p>var x,y |

</p><p>x=5</p><p>y=12.8</p><p>call 105_dist2d,x,y</p><p>var res=result()</p><p>print res</p><p>end</p>                                          |
| 0105\_dist2d.job | <p># Calc. Euclide distance 2D</p><p>param x,y</p><p>var tmp</p><p></p><p>tmp=x*x+y*y</p><p>var len=sqr(tmp)  # distance from origin</p><p>return len</p> |
| Result           | 13.742                                                                                                                                                           |

In job no. 1, the dist2d subprogram is called with the **call** statement, and “x, y,” which are local variables, are passed. In the dist2d subprogram, “ldX,” and “ldY” defined with the **param** statement are called “formal parameters,” and “x, y” passed to the **call** statement are called “actual parameters.”&#x20;

The dist2d program transports resulting values to external destinations through **return** statements. Returned values can be obtained by calling a result() function in the called program.

(A **return** statement and an **end** statement have the same action as they end a called program and return to the main program. However, a **return** statement is different from an **end** statement as the former can designate a resulting value as an element).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hyundai-robotics.gitbook.io/hi6-robot-language/rl-english/flowcontrol-subprogram/call-jump/param-return.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
