Library Stacks PART II

Frank Leahy frank at backtalk.com
Sun Feb 29 19:11:56 EST 2004


On Sunday, February 29, 2004, at 11:23  PM, 
use-revolution-request at lists.runrev.com wrote:

>
> 2.  A start using from multiple stacks (main or sub) for the same 
> library will cause a unnerving message from RR.
>
> How do I use a libray wich I wish to include from all my stacks 
> without experiencing this error?
>

use try/catch

try
    start using stack "foo"
catch err
   -- ignore the error
end try

You might want to execute code in the catch that checks for different 
types of errors.  If I were you I would force an error to be thrown by 
starting to use a non-existent stack and use the debugger to see what's 
in "err".  Then I would throw an error by starting to use a stack for 
the second time, and see what's in "err" under that condition.  So your 
code might become:

try
   start using stack "foo"
catch err
    if err = "stack missing error" then -- change this to the correct 
error string
       answer error "Error: oops, stack foo couldn't be found!"
    else if err = "using stack twice" then -- change this also...
       -- ignore this error
     else
        answer error "Error: unknown error caught when call start using 
stack foo, err = " & err
end try

-- Frank



More information about the use-livecode mailing list