These are the functions I have:<br><br>function stack_Exists someName<br>    -- will not add stack to memory<br>    <br>    set lockmessages to true<br>    put the mainstacks into stacksInMemory<br>    put empty into shortStackName
<br>    if exists(stack someName) then<br>        put true into safeExistence<br>        put not(shortStackName is among the lines of stacksInMemory) into needToClose<br>        if needToClose then<br>            stack_CloseMain someFile
<br>        end if<br>    else<br>        put false into safeExistence<br>    end if<br>    set lockmessages to false<br>    return safeExistence<br>end stack_Exists<br><br>on stack_CloseMain stackName<br>    if there is a stack stackName is false then
<br>        return false<br>    end if<br>     <br>    set lockmessages to true<br>    put the mainstack of stack stackName into mainStackName<br>    -- set the destroystack of stack mainStackName to true<br>    -- set the destroywindow of stack mainStackName to true
<br>    close stack mainStackName<br>    if there is a stack mainStackName then<br>        delete stack mainStackName<br>    end if<br>    set lockmessages to false<br>    return true<br>end stack_CloseMain<br><br>