{"identifier":28715,"topic":"Keywords","name":"return","text":"<code>return <i>expression<\/i><\/code> <br><br>\n\n The<code> return <\/code>keyword ends execution of a handler and, in function handlers, returns the value of<code> <i>expression<\/i> <\/code>to the handler that called the function. <br><br>\n\n If<code> return <\/code>appears in a message handler (as opposed to a function handler), it ends execution of the handler and places the value of the expression into the HyperTalk function<code> the result<\/code>. <br>\n<br>\nThe value of<code> the result <\/code>as set by a<code> return <\/code>statement is valid only immediately after the<code> return <\/code>statement executes; each new statement resets<code> the result <\/code>to<code> empty.<\/code> <br>\n","related":{"25888":"function","26982":"on","62431":"result"},"examples":"","demo":"<code><pre>on whatDisk\n  answer \"This stack resides on the disk named\" && diskName() & \".\"\nend whatDisk\nfunction diskName longStackName\n  if longStackName is empty\n  then put the long name of this stack into longStackName\n  delete char 1 to 7 of longStackName -- remove \u201cstack \"\u201d\n  <b>return<\/b> char 1 to (offset(\":\",longStackName) - 1) of longStackName\nend diskName<\/pre><\/code>\n ","debug":{"9":["return expression\r\rT"],"10":["The value of the res"]}}