Re: default arguments/parameters
Re: default arguments/parameters
- Subject: Re: default arguments/parameters
- From: "Arthur J. Knapp" <email@hidden>
- Date: Thu, 09 Oct 2003 11:17:03 -0400
>
From: "Rua Haszard Morris" <email@hidden>
>
Subject: default arguments/parameters
>
Date: Thu, 9 Oct 2003 14:17:51 +1000
>
Is there a way to define a handler to take default positional
>
parameters?
No, the language does not have this functionality. It also doesn't
allow optional parameters... a far more serious deficit.
>
to displayplaindialog(optional texttoshow = "default text")
>
display dialog texttoshow
on DisplayDialog(vSettings)
set r to {_prompt:"Hello World", _field:"", _push:{"OK"}, _default:"OK"}
if (vSettings's class = string) then
set r's _prompt to vSettings
else if (vSettings's class = record) then
set r to vSettings & r
end if
display dialog (r's _prompt) default answer (r's _field) buttons (r's
_push) default button (r's _default)
end DisplayDialog
DisplayDialog(0) --> use all defaults
DisplayDialog(false) --> use all defaults
DisplayDialog(missing value) --> use all defaults
DisplayDialog("Admiral Novia") --> set prompt
DisplayDialog({_push:{"Yes", "No"}, _default:"Yes"}) --> set buttons
>
I get the feeling these things can be done but there is not
>
standard predefined way to do em, and there's no conventional way
>
either (everyone does it their own way)..
I certainly always do things my own way...! :)
Apple provided few means of creating handlers with "intelligent"
parameters. If your creating script libraries for others to use,
there are no "standard predefined" conventions, just document how
your doing things as well as possible.
{ Arthur Knapp, of <
http://www.STELLARViSIONs.com>
a r t h u r @ s t e l l a r v i s i o n s . c o m
"Safe the Nature" --> political graffiti in Prague
}
_______________________________________________
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.