Optional Parameter in Handler
Optional Parameter in Handler
- Subject: Optional Parameter in Handler
- From: Ed Walter <email@hidden>
- Date: Thu, 21 Nov 2002 15:46:11 -0600
Has anyone come up with a good way to have an optional parameter in a
handler?
Such as:
----------------------------------------------------
Property methodList:{"Peace","Love","Understanding"}
on saveWorld(Command,methodList)
set notHandled to {}
repeat with theString in methodList
if Command = "Verbal" then
say theString
else if Command = "Visual" then
display dialog theString
else
set notHandled to notHandled & theString
end if
end repeat
return notHandled
end saveWorld
----------------------------------------------------
Where... saveWorld("Verbal") would actually work by picking up the values
for theMethod from the property and say each one. I know all I have to do is
saveWorld("Verbal",methodList) setting the property of methodList before the
call, but I just wonder if anybody had a good way to simulate optional
parameters in an AS handler?
Thanks!
-ed-
_______________________________________________
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.