HyperCard: Script to Go Back to Previous Stack (7/92)

The handler GoBackStack takes you back to the stack you were in before the
current one. It uses information that is saved by rememberStack.

RememberStack is called from the closeStack handler in this stack. That
means you can only go back to stacks that pass closeStack, so make sure all
your favorite stacks do so.

on rememberStack
global backTrackStacks
get short name of this stack
if it is not last line of backTrackStacks -- prevent consecutive duplicates
then put it & return after backTrackStacks
end rememberStack

on goBackStack
global backTrackStacks
get backTrackStacks
put last line of it into dest
delete last line of it
if dest is empty then go home else go to stack dest
put it into backTrackStacks -- global changed during go
end goBackStack


This article is adapted from the Claris Tech Info database.
Published Date: Feb 19, 2012