Script Only Stack Behaviors and Nesting
bobsneidar at iotecdigital.com
Mon Jul 2 13:05:57 EDT 2018
Hi all. I nailed this down, and it is indeed as someone surmised, that even though the script editor variable watcher indicated that script local variables had the correct values, it was showing me the BEHAVIOR's script local variable values, and NOT those for the STACK, which were in fact still empty (not initialized).
This is likely going to bite others in the butt in the future, who use the same script local variables in their behaviors as they do in their parent script. Who knows, maybe I'm going to be the only one in the history of LC to try this, but I just thought I'd toss that out there, in case anyone else gets obscure bugs where a statement ought to work and doesn't.
> On Jun 27, 2018, at 15:50 , Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
> Hi all.
> I'm getting heavily into behaviors and script only stacks now (in preparation for Levure Framework) because my project has become complex enough to make it almost inevitable. I have perhaps 20 or so substacks in a mainstack. All the substacks have quite a bit of shared behavior, so I created a button with the common code for all the stacks, then set the behavior of each stack to the long ID of that button. So far so good. It works famously.
> But I also took the non-common code for each stack, and saved each one as a .livecode script only stack but have yet to set the behavior of the substacks to them. I will eventually do the same for the common code behavior mentioned above.
> Now I want to nest the behaviors in such a way so that each stack can avail itself of both behaviors. So the first question is, Which behavior should be the first behavior I set the stack to, or does it matter? The next is, how do I nest behaviors of script only stacks? I know I can set the behavior of one button to the behavior of another whose behavior is that of another etc. But how do I do that with script only stack files?
> Bob S
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode