REALLY close stack - no, really

John Rule johnrule at rcsprogramming.com
Tue Jun 15 19:53:07 EDT 2004


Does this feature actually benefit anyone? In all of the years I have used
MC or RR I have been fighting this 'Purge' annoyance (and I have lost some
work because of it). I now just make sure that the 'Destroy' attributes are
set (destroy window and destroy stack)...this works 'mostly', but not
always. I wish it would just be taken out of the engine itself....when I
close a window, I am closing it! If I want to keep it in memory, I will
'hide' it myself.


JR


> Date: Tue, 15 Jun 2004 17:51:49 -0400
> From: Troy Rollins <troy at rpsystems.net>
> Subject: REALLY close stack
> To: How to use Revolution <use-revolution at lists.runrev.com>
> Message-ID: <341FDC44-BF16-11D8-B3E9-000A95A09CF8 at rpsystems.net>
> Content-Type: text/plain; charset=US-ASCII; format=flowed
>
> Greets,
>
> I have a stack which references a number of external stack files as
> resources. Only one of these resources can be "active" at a time. The
> user can create these resource stacks, and name them whatever they
> want... but they all have the same "internal" stack name.  When my
> program starts, it looks through the resource directory, loads them one
> by one, extracts enough information to reload the file as the "main
> resource" when requested by selecting it from a list of available
> resources.
>
> The problem? You probably guessed it. Rev won't purge the first file,
> and always complains that there is already a stack open with that name.
>
> In my repeat loop which reads the files I "repeatedly" try to kill the
> darn thing, but they are very persistent. It looks something like this
> -
> _________________________________________________________
>   repeat for each line tFile in tFileList
>      if there is a stack "Current Resource" then
>        set the destroyStack of stack "Current Resource" to TRUE
>        close stack "Current Resource"
>      end if
>
>        go invisible stack URL (the defaultFolder & "/" & tFile)
>        if there is a field "NameField" of stack "Current Resource" then
>
>          Put tFile & TAB & field "NameField" of stack "Current Resource"
> after field "Resource Select List" of card "Main Interface" of stack
> "The Program"
>        end if
>
>      set the destroyStack of stack "Current Player" to TRUE
>      close stack "Current Player"
>
>    end repeat
> ________________________________________________________
>
> In other words, I try to kill the bugger twice, but no go. Is there a
> "best way" to use and kill a stack, so that another which has the same
> stack name can be used without error messages?
>
> Back workin' in Rev, but a bit rusty I guess. Thanks for any help.
> --
> Troy
> RPSystems, Ltd.
> http://www.rpsystems.net
>
>



More information about the use-livecode mailing list