RE: Error Context (used to be Inheritance)
RE: Error Context (used to be Inheritance)
- Subject: RE: Error Context (used to be Inheritance)
- From: "Wallace, William" <email@hidden>
- Date: Wed, 21 Jan 2004 15:35:49 -0600
- Thread-topic: applescript-users digest, Vol 3 #2357 - 14 msgs
Oops! My example code from my last post should read:
--main script
global scriptVar1, scriptVar2, errNum, errMsg
set scriptVar1 to (load script alias "path:to:script1")
set scriptVar2 to (load script alias "path:to:script2")
try
set p to 1/0
on error errMsg number errNum
tell scriptVar1 to doSomething(errNum, errMsg)
display dialog "Main Error! " & errNum & return & errMsg
end try
--loaded script 1
on doSomething(myNum, myMsg)
try
set myBungle to myNum / myMsg
on error errMsg number errNum
tell my parent's scriptVar2 to doSomethingElse(errNum, errMsg)
display dialog "Script 1 Error! " & errNum & return & errMsg
end try
end doSomething
--loaded script 2
on doSomethingElse(theNum, theMsg)
try
set myFauxPas to (theMsg + theNum)
on error errMsg number errNUm
display dialog "Script 2 Error! " & errNum & return & errMsg
end try
end doSomethingElse
I'm guessing the problem relates to the context of the handler "doSomethingElse" but I don't really understand what that means. To my thinking the handlers "doSomething" and "doSomethingElse" are contained in the global variables "scriptVar1" and "scriptvar2" and thus should be visible globally. Shouldn't they be able to call each other through the parent script?
B!ll
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.