SubStacks and message path
keith.clarke at clarkeandclarke.co.uk
Sat Jun 4 06:58:57 CDT 2011
Thanks for the response, clarification and tips.
This app has one MainStack (so far!) and it's script contains a handler on preOpenStack, to start using stack "SOAP". So, thanks for confirming that this should place the SOAP substack into the message path library 'slot' for the MainStack and any other substacks (such as this login one). So, maybe I just had a typo somewhere - that wouldn't be a first!
On 4 Jun 2011, at 12:22, Jim Ault wrote:
>> On 4 Jun 2011, at 09:07, Keith Clarke wrote:
>>> Hi folks,
>>> I'm using a substack 'Credentials' as a dialogue box to capture login credentials for a web service (tUsername, tPassword).
>>> A second 'SOAP' substack acts as a library managing the various POST messages for the web service, including a function login pUsername pPassword
>>> If I attempt to use 'do login(tUsername, tPassword)' in a button on the Credential's substack, the script throws errors - so I'm assuming that the SOAP substack is not in the Credentials substack's message path.
>>> So, I'm trying the call function for the first time, but get errors with call login(tUsername, tPassword) of stack "SOAP"
>>> Any clues as to what I'm dong wrong?
> No need for fancy maneuvers. Just use the straight forward approach.
> You could do a simple one-liner in the 'on openstack' of the SOAP stack script.
> start using stack (the short name of me)
> If you do this in the main stack, then use
> start using stack "SOAP functions"
> -- this puts only the stack script into the'library' part of the message path
> Now that script container will be after ANY main stack & substacks you open.
> The path will be
> main stack, then SOAP, then back, then engine
> unless the SOAP stack is front most window, then
> SOAP stk, main stack, then SOAP, then back, then engine
> -- thus twice, if and only if you pass your handler and function traps
> Switch to another main stack and SOAP remains in the path.
> main stack 2, SOAP stk, then back, then engine
> The best practice is to keep SOAP in memory rather than close it after executing "start using", unless you execute "stop using", then close. Otherwise, Livecode will try to keep the stack open in memory, since you said you needed it.
> Hope this helps
> Jim Ault
> Las Vegas
More information about the use-livecode