</head> <body> <h1>Return</h1> <p>서브루틴으로부터 이전에 실행을 점프했던 곳으로 돌아갑니다. <a href="../Functions.htm">함수-호출</a>, <a href="Gosub.htm">Gosub</a>, <a href="../Hotkeys.htm">핫키</a> 활성화, <a href="GroupActivate.htm">GroupActivate</a>, 기타 등등의 방법으로 점프했던 곳으로 돌아갑니다.</p> <pre class="Syntax"><span class="func">Return</span> <span class="optional">, Expression</span></pre> <h2 id="Parameters">매개변수</h2> <dl> <dt>Expression</dt> <dd><p>이 매개변수는 생략해야 합니다. 단, <code>return</code>이 <a href="../Functions.htm">함수</a> 안에 사용될 때는 예외입니다.</p> <p>이 매개변수가 <a href="../Variables.htm#Expressions">표현식</a>이면, 다음은 모두 유효한 예제입니다:</p> <pre>return 3 return "문자열을 그대로 반환" return MyVar return i + 1 return true <em>; 숫자 1을 돌려주어 "true"를 나타냅니다.</em> return ItemCount &lt; MaxItems <em>; 참이나 거짓을 돌려줍니다.</em> return FindColor(TargetColor)</pre> <p><strong>알려진 한계</strong>: 하위 호환을 위해 그리고 사용의 편의를 위해, 다음 두 예제는 기능적으로 동일합니다:</p> <pre>return MyVar return %MyVar%</pre> <p>다른 말로, 변수 하나가 퍼센트 사인에 둘러 싸여 있으면 표현식이 아닌 것으로 취급됩니다. 이를 우회하려면, 반괄호로 둘러 싸서 확실하게 표현식으로 만드십시오; 예를 들어: <code>return (%MyVar%)</code>.</p></dd> </dl> <h2 id="Remarks">논평</h2> <p>돌아갈 호출자가 없다면, <em>Return</em>은 대신에 <a href="Exit.htm">Exit</a>을 수행합니다.</p> <p>함수로부터 호출자에게 여러 값을 돌려주는 다양한 방법이 있습니다. <a href="../Functions.htm#return">값을 호출자에게 돌려주기</a>에 자세하게 기술되어 있습니다.</p> <h2 id="Related">관련 항목</h2> <p><a href="../Functions.htm">함수</a>, <a href="Gosub.htm">Gosub</a>, <a href="Exit.htm">Exit</a>, <a href="ExitApp.htm">ExitApp</a>, <a href="GroupActivate.htm">GroupActivate</a></p> <h2 id="Examples">예제</h2> <div class="ex" id="ExBasic"> <p><a class="ex_number" href="#ExBasic"></a> The first Return separates the hotkey from the subroutine below. If it were not present, pressing the hotkey would cause <code>Sleep 1000</code> to be executed twice.</p> <pre>#z:: MsgBox Win-Z 핫키가 눌렸습니다. Gosub MySubroutine return MySubroutine: Sleep 1000 return</pre> </div> </body> </html>