# /return

## Syntax

**/return \[value|${varname}]**

## Description

Returns to the line immediately following the call. Can return values or variables.

## Examples

```
Sub Add(int A, int B)
  /declare Sum int local ${Math.Calc[${A}+${B}]}
/return ${Sum}
```

Return can also be used to exit out of a [subroutine](/macroquest/documentation/subroutines.md) early.

```
Sub Evade
  /if (!${Me.AbilityReady[Hide]}) {
     /echo Hide has not refreshed, so we are leaving early.
     /return
  }
  /echo Hide is ready, so we will continue processing
  /attack off
  /doability Hide
  /delay 5
  /attack on
/return
```


---

# Agent Instructions: 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:

```
GET https://macroquest.gitbook.io/macroquest/commands/macro-commands/return.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
