Re: Passing *possible* variables to a handler
Re: Passing *possible* variables to a handler
- Subject: Re: Passing *possible* variables to a handler
- From: Nigel Garvey <email@hidden>
- Date: Fri, 12 Jul 2002 09:59:11 +0100
Landis wrote on Thu, 11 Jul 2002 17:52:50 -0700:
>
I want to pass a record that may or may not contain certain options
>
to a handler. This is what I've come up with, please tell me that
>
I'm overlooking some basic, much easier way to do this. I'm at a
>
loss.
>
>
(I'm also not positive I'm making sense, been staring at a screen too long)
>
>
<START SCRIPT>
on ThisHandler(varA, varB, varRec)
set defaultRec to {varC:3, varD:4}
if varRec is "" then
set varRec to defaultRec
else
set varRec to varRec & defaultRec
end if
set ansA to varA
set ansB to varB
set ansC to varRec's varC
set ansD to varRec's varD
return {ansA, ansB, ansC, ansD}
end ThisHandler
When you concatenate two records together, the values of the labels in
the first record take precedence. If the second record has labels that
the first does not, these and their values are used in the combined
record:
{varC:27} & {varC:3, varD:4}
--> {varC:27, varD:4}
NG
_______________________________________________
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.