stack 0 (?)

Sarah Reichelt sarahr at
Wed Mar 6 21:53:01 EST 2002

> On a related subject, with both versions of this I have found a *VERY*
> odd problem. I have a "tabbed button" and the text for the tabs are
> something like: 
> "Sect. 1, 2, and 3"
> "Sect. 2, and 4" 
> "Sect. 5, 6, and 7"
> "Sect. 8" 
> And I do something like this in the action for the button:
> on mouseUp 
> go to card the selectedtext of me of stack "FAA Form 337"
> end mouseUp 
> As a result i have several cards with the same names "Sect. 1, 2, and
> 3", "Sect. 5, 6, and 7", etc.  Now what happens is really strange
> The text of the card names actually gets changed to something else
> sometimes.  I dont' have the exact string, because I have recently
> corrected it. But it is something like:  "Sect. 1/REVOLUTION01
> 2/REVOLUTION01 3/REVOLUTION01".  It works for a while and then it
> screws up. It looks like it is choking on the "," character.

I tried a similar button and had no problems, but as a genreal rule, I think
you would be better to use a menuPick handler rather than a mouseUp

on menuPick pChoice
    go to card pChoice of stack "FAA Form 337"
end menuPick

>> needs to get access to
>>> the controls on it's parent stack....
>> Use "the mainStack of this stack". This gives you the name of
>> the parent 
>> stack. Note that if you build an application with the
> I have tried this and I just can't get it to work.. ;<
> Here is my original line:
> on openStack 
> repeat with x = 1 to the number of lines of the cardIDs of stack "Form"

> The problem with this is it has the "Form" hardcoded and every attempt I
> have done to make it non-hard coded has basically failed.

Is this openStack handler in stack "Form"? If so, you can use:
    put the short name of this stack into myStack

otherwise, if "Form" is the main stack in your file:
    put the mainStack of this stack into myStack

Then everywhere you use "Form", use myStack instead.

> I just want to make sure I understand. If I do some procedure in
> "openStack" which adds fields to the form and then do a "closeStack".
> The next time I open the stack for printing it will print new fields
> correct?  I think what you are suggesting is to not do the
> "closeStack" and just let it stay open. In a "built application" will
> this present a problem when the users closes my application?. I don't
> want them to have the ability to save that stack, just have it exit
> without saving the changes.
So long as you don't want changes saved, then you can do what you say. Make
the new fields in your openStack handler. Whether you have a closeStack or
not is irrelevant but you want this stack to be part of your application.
This makes it read-only so no changes can be saved.


More information about the use-livecode mailing list