Strange behavior

Ken Ray kray at sonsothunder.com
Fri Jan 11 09:47:01 EST 2002


The reason you get the strange behavior is the "go to card 1 of stack
"textoid"" line. The first time I ran your code, I got one window that
looked right. Then I closed the window and ran it again, and experienced the
behavior you identified.

What's happening is that when you close a stack, if the destroyStack
property of the stack is not turned on, the stack stays in memory, even if
it is closed. The next time you go to open a stack by that same name, it
quickly grabs it from memory.

In your case, this is what happens (after you have run this already once):

1) the stack "textoid" is closed, but remains in memory (stack #1)
2) you run the script and encounter the "create stack" command, which
creates a stack in front of stack #1 and names it "textoid" as well
3) the "go to card 1 of stack "textoid"" command actually goes to stack #1,
and brings it to the front (this stack already has a field in it, sized
properly)
4) you then create a field (which actually creates fld 2 since there's
already one there), then set the rect of fld 1 (which has previously been
set to its proper size in the previous session)
5) finally, you put text into fld 1

To fix this, I would recommend (a) setting the destroystack and
destroywindow properties of the stack to true (couldn't hurt to have it
always flushed from memory), and (b) change your "go to card 1" line to "set
the defaultStack to the topStack" (which moves the internal focus to the new
stack you created so you can create your field).

Hope this helps,

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/
----- Original Message -----
From: <xbury.cs at clearstream.com>
To: <metacard at lists.runrev.com>
Sent: Friday, January 11, 2002 3:46 AM
Subject: RE: Strange behavior


> Actually i got the same behavior after a couple runs from the clean
> installed MC stack.
>
> I tried in vain to put a breakpoint but that command doesn't work for
> nothing.
>
> Anyone has any idea?
> Im really lost... and nothing in the debugging section seems to work in
this
> case.
> There is no error in the script, nothing should intercept the script if
lock
> messages is on but it happens... (im using 2.4b2 and b4). Version 2.3
seems
> to work ok but im not working with that version anymore...
>
> thanks again for the help!
> Xavier
>
> > on textoid txt
> >   lock messages
> >   create stack
> >   set name of the topstack to "Textoid"
> >  go to card 1 of stack "textoid"
> > -- why is the previous line necessary? go figure...
> >  create field
> >  set the rect of fld 1 to the rect of card 1
> >  put txt into fld 1
> > end textoid
> >
> > then type in the message something like:
> > textoid "hello"
> >
> > Sounds simple, but for some crooked reason, what happens is
> > that I get two
> > stacks, both are called "textoid", one is empty, the other
> > has one field
> > with the rect of the stack and the text that was in the
> > param, and then
> > there's at least 1 more "raw" field with no text above the
> > first one...
> >
> > If i reinstall MC, and put it into the blank home stack, it
> > works correctly.
> > But then what good is the lock messages for? I've commented
> > out also the
> > openstack/newfield, etc... scripts...
> >
> > Can anyone explain?
> >
> >
> > Visit us at http://www.clearstream.com
> >
> > IMPORTANT MESSAGE
> >
> > Internet communications are not secure and therefore
> > Clearstream International does not accept legal
> > responsibility for the contents of this message.
> >
> > The information contained in this e-mail is confidential and
> > may be legally privileged. It is intended solely for the
> > addressee. If you are not the intended recipient, any
> > disclosure, copying, distribution or any action taken or
> > omitted to be taken in reliance on it, is prohibited and may
> > be unlawful. Any views expressed in this e-mail are those of
> > the individual sender, except where the sender specifically
> > states them to be the views of Clearstream International or
> > of any of its affiliates or subsidiaries.
> >
> > END OF DISCLAIMER
> > _______________________________________________
> > metacard mailing list
> > metacard at lists.runrev.com
> > http://lists.runrev.com/mailman/listinfo/metacard
> >
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard
>




More information about the metacard mailing list