open and close stack command
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 137
- Joined: Thu Jul 24, 2008 11:22 pm
open and close stack command
I notice that with an OpenStack command I have written that it applies to all the substacks as well as the main stack of my application. is there a way to limit it to a specific stack? i.e. either the main stack or one of the substacks.
cheers
Glenn
cheers
Glenn
Re: open and close stack command
Hi Glenn,
Yes, you can trap the message with an openstack for one or each substack
regards
Jean-Marc
Yes, you can trap the message with an openstack for one or each substack
regards
Jean-Marc
https://alternatic.ch
-
- Posts: 137
- Joined: Thu Jul 24, 2008 11:22 pm
Re: open and close stack command
how aout an example?
cheers
cheers
Re: open and close stack command
Hi Glenn,
you can:
1. put an empty "dummy" handler in all of your substacks:
2. Put the "pre-/openstack" handlers of your mainstack into the script of card 1 of your mainstack,
since these messages are also sent to the first card of the stack.
That's what I do all the time, works fine!
Best
Klaus
you can:
1. put an empty "dummy" handler in all of your substacks:
Code: Select all
on openstack
##
end openstack
on preopenstack
##
end preopenstack
since these messages are also sent to the first card of the stack.
That's what I do all the time, works fine!
Best
Klaus
Re: open and close stack command
Hey Klaus...
That is a nice work around regarding putting the preOpenStack & openStack handlers on the first card... We live and learn, I never knew that.. but I don't want you taking all the credit as I bet your cat told you about this
be well
Dixie
That is a nice work around regarding putting the preOpenStack & openStack handlers on the first card... We live and learn, I never knew that.. but I don't want you taking all the credit as I bet your cat told you about this

be well
Dixie
Re: open and close stack command
Hi Dixie,
well, to be honest, both of my cats told me
well, to be honest, both of my cats told me

-
- Posts: 137
- Joined: Thu Jul 24, 2008 11:22 pm
Re: open and close stack command
Thanks. I'll give it a try
-
- Posts: 137
- Joined: Thu Jul 24, 2008 11:22 pm
Re: open and close stack command
This is getting really frustrating. the other day the following script worked perfectly except that it worked with all the substacks as well. today I get anerror message saying it can't find the stack "apdata" which is located with the stack that has the script but is not a substack.
Code: Select all
on openstack
put fld "ProductSpecs" of card "productSpecs" of stack "APdata" into fld "productSpecs" of card "Product Specification" of this stack
put fld "blends" of card "blends" of stack "APdata" into fld "specdata" of card "Compound Specification" of this stack
end openstack
Re: open and close stack command
Hi Glenn,
The operation on openstack may be a bit confusing at times. One thing you need to note is that when you say "stack" in script, it acts upon the current stack, now note that a substack is also a stack hence any refence to make while you at at the substack level but intending to refer to cards in the mainstack, just calling this stack will cause the error. At this level, you would need to reference the card in mainstack accordingly i.e
the card "ABCD" of stack "MAINSTACK NAME"
In my example file, ACME Ltd is the main stack and I have
DEPARTMENT A
DEPARTMENT B
Now, if I mean to operate for all items regardless to where they reside (as in the cards of this stack or a substack of this stack), I can reference them using ACME Ltds script call. In this case, I have
ACME MAIN's openstack script
whose effect is as expected, but to show that this only will be possible, I have added a similar openstack on card "ACME MAIN" whose effect on fld "lblAddress" will only be to itself and not the substacks field with a similar name.
To have this call of openstack on card "ACME MAIN" effected the change to say the label on substack DEPARTMENT A, card Transport, just uncomment the line
This leaves the card on substack DEPARTMENT B the only one not altered.
I hope this helps you work out the calls in your script.
kotikoti
The operation on openstack may be a bit confusing at times. One thing you need to note is that when you say "stack" in script, it acts upon the current stack, now note that a substack is also a stack hence any refence to make while you at at the substack level but intending to refer to cards in the mainstack, just calling this stack will cause the error. At this level, you would need to reference the card in mainstack accordingly i.e
the card "ABCD" of stack "MAINSTACK NAME"
In my example file, ACME Ltd is the main stack and I have
DEPARTMENT A
DEPARTMENT B
Now, if I mean to operate for all items regardless to where they reside (as in the cards of this stack or a substack of this stack), I can reference them using ACME Ltds script call. In this case, I have
ACME MAIN's openstack script
Code: Select all
on openStack
--called from the stacks script
put "123 West of East" into fld "lblAddress"
end openStack
To have this call of openstack on card "ACME MAIN" effected the change to say the label on substack DEPARTMENT A, card Transport, just uncomment the line
Code: Select all
--put "1015 Courts Corner Street" into fld "lblAddress" of card "Transport" of stack "DEPARTMENT A"
This leaves the card on substack DEPARTMENT B the only one not altered.
I hope this helps you work out the calls in your script.
kotikoti
Last edited by kotikoti on Fri May 28, 2010 7:26 pm, edited 2 times in total.
Build 160
Version 2.9.0
Platform: Windows
Version 2.9.0
Platform: Windows
Re: open and close stack command
Hi Glenn,
if you want to access data from a stack that is NOT currently okpen, you need to supply the filenmae rather than the (short) name of the stack!
Best
Klaus
if you want to access data from a stack that is NOT currently okpen, you need to supply the filenmae rather than the (short) name of the stack!
Code: Select all
on openstack
put the effective filename of this stack into tFilename
set itemdel to "/"
put "APdata.rev" into item -1 of tFilename
## or whatever the FILENAME of that stack is
put fld "ProductSpecs" of card "productSpecs" of stack tFilename into fld "productSpecs" \
of card "Product Specification" of this stack
put fld "blends" of card "blends" of stack tFilename into fld "specdata" of card "Compound Specification" of this stack
end openstack
Klaus