Re: Deafult or optional arguments to handlers
Re: Deafult or optional arguments to handlers
- Subject: Re: Deafult or optional arguments to handlers
- From: "Daniel A. Shockley" <email@hidden>
- Date: Tue, 23 Apr 2002 12:12:55 -0400
Subject: Re: Deafult or optional arguments to handlers
Cc: email@hidden (Michael Sullivan)
To: AppleScript Users <email@hidden>
From: Paul Skinner <email@hidden>
Paul, I do something similar (although not with the nice 'here's what
I do' feedback). I also put a simple default parameters ability and
required parameters check in my handler template as follows:
if class of parameters is record then
-- if you're going to use record-passed parameters, then here's
-- a simple way to have default values
set defaultParameters to {someOption:"", someOtherOption:"",
responseType:"Record"}
set parameters to parameters & defaultParameters
end if
try
set requiredParam1 to requiredParam1 of prefs
set requiredParam2 to requiredParam2 of prefs
on error errMsg
error handlerName & " FAILED (a required parameter is missing):" & errMsg
end try
--
----
Daniel A. Shockley
email@hidden
email@hidden
http://www.danshockley.com
_______________________________________________
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.