Changing a stack script on the fly and other stuff

Jason Vickers jvickers2002 at hotmail.com
Sun Aug 21 13:29:47 EDT 2005


Ken,
Thanks for that suggestion.  The original script you gave me didn't work 
(maybe it waasn't supposed to, though), but I did modify it to look for a 
value in a hidden field [ if sName <> "mc" and (field "trial" card 1 <> 
"nosave") then ].  Using the control card, I added a line to set the field 
"trial" to "nosave".  That solved the problem.

Had it not been for your suggestion, I would have sat here staring blankly 
at my screen for hours.  I am fairly new to Revolution and fear that most of 
my scripting looks like Frankenstein's monster...

Anyway, thanks again for the suggestion; it set me on the right path to 
solving the problem.

Jason


----- Original Message ----- 
From: "Ken Ray" <kray at sonsothunder.com>
To: "Use Revolution List" <use-revolution at lists.runrev.com>
Sent: Monday, August 22, 2005 12:29 AM
Subject: Re: Changing a stack script on the fly and other stuff


> On 8/21/05 9:09 AM, "Jason Vickers" <jvickers2002 at hotmail.com> wrote:
>
>> In order to prevent future saving to this stack, I want to comment out 
>> the "on
>> closeStack" portion of the stack script.
>
> Well, you're going to run into problems with changing scripts at runtime -
> there are script limits (10 lines I believe) that you can change from a
> standalone, so that's not going to work for you most likely.
>
> Better approach would be to set a custom property in the stack that
> identifies whether it can be saved or not. For example, you could set the
> "uCantSave" of a stack to "true" to prevent the ability of saving the 
> stack
> my modifying the closeStack handler as follows:
>
> on closeStack
>  put the short name of this stack into sName
>  if sName <> "mc" and (the uCantSave of this stack is not "true") then
>    answer "Do you want to save this stack?" with "yes" or "no"
>    if it is "yes" then
>       save this stack as stack "myStack"
>       set the uCantSave of stack "myStack" to true
>       save stack "myStack"  -- make the property change permanent
>    end if
>  end if
> end closeStack
>
> HTH,
>
> Ken Ray
> Sons of Thunder Software
> Web site: http://www.sonsothunder.com/
> Email: kray at sonsothunder.com
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 



More information about the use-livecode mailing list