Home THE HYPERCARD CENTER

HyperTalk Reference
Home » HyperTalk Reference »

Note: This is a work in progress and many formatting issues have been fixed. Read more about the project on the home page.

return

return expression

The return keyword ends execution of a handler and, in function handlers, returns the value of expression to the handler that called the function.

If return 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 the result.

The value of the result as set by a return statement is valid only immediately after the return statement executes; each new statement resets the result to empty.

Demo Script

on whatDisk
answer "This stack resides on the disk named" && diskName() & "."
end whatDisk
function diskName longStackName
if longStackName is empty
then put the long name of this stack into longStackName
delete char 1 to 7 of longStackName -- remove “stack "”
return char 1 to (offset(":",longStackName) - 1) of longStackName
end diskName

Related Topics

Placeholders

expression

HyperTalk Definition

Any HyperTalk expression. All expressions evaluate to text, a number, or a constant.

For example:

true
sin(90)
"this is" && it
(3+2) = 5
the heapspace div 1024

Note: Formally, HyperCard distinguishes between factors (simple values) and expressions. The difference between factors and expressions matters only if you like to drop parentheses. Most functions take factors as their parameters, which is why length of 3 + 5 returns 6 and length of (3 + 5) returns 1. In short, always use parentheses to group things the way you want them to evaluate, and you won’t have to worry about the difference between factors and expressions.

AppleScript Definition

Any series of words that has a value.

HyperTalk Reference


Version 0.8b4 (July 4, 2025)

Made with Macintosh

Switch to Modern View