Re: Optional parameters in Handlers????
Re: Optional parameters in Handlers????
- Subject: Re: Optional parameters in Handlers????
- From: John Delacour <email@hidden>
- Date: Sun, 13 Apr 2003 00:49:10 +0100
- Mac-eudora-version: 6.0a15
At 12:58 am +0200 13/4/03, Jakob Peterhdnsel wrote:
Is it possible to have optional parameters in handlers?
Like:
on myHandler(param1, [optional_1], [optional_n])
end myHandler
Yes, just use a list or record
processArgs({1, 2, 3})
--> 30
processRecord({a:1, b:2, c:3})
--> {3,5}
on processArgs(args)
set x to 5
repeat with arg in args
set x to x * arg
end repeat
end processArgs
on processRecord(hash)
set len to count hash as list
set x to 5
try
set x to x + (d of hash)
end try
return {len, x}
end processRecord
_______________________________________________
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.