• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Non Compulsory Parameters & a Null Constant?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Non Compulsory Parameters & a Null Constant?


  • Subject: Re: Non Compulsory Parameters & a Null Constant?
  • From: julifos <email@hidden>
  • Date: Wed, 12 Feb 2003 10:59:48 +0100

> hi all.
>
> couple of basic queries.
>
> is there a way to specify parameters in a handler that are not compulsory in
> a call to that handler.

You can define a global variable and forget parameters in your handler. Eg.

####################
global x

set x to false --> default value for x

--> some condition can modify x's value
if weekday of (current date) is Wednesday then set x to true

doStuff()

to doStuff()
if x then beep
end doStuff
####################

> Some what related other question.
>
> Is there a constant along the lines of NULL or VOID from other languages
>
> My desire for this is to determine if a variable already exists.


There are some constants such as "null" or "missing value", but these are
only equal to theirselves. To check for a variable which does not exists,
you can handle an error:

####################
try
bar
set bar_is_defined to true
on error --> bar undefined
set bar_is_defined to false
end
####################

JJ
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.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.

  • Prev by Date: Re: Saving a document in Safari
  • Next by Date: search and replace in tex-edit
  • Previous by thread: Re: Non Compulsory Parameters & a Null Constant ?
  • Next by thread: search and replace in tex-edit
  • Index(es):
    • Date
    • Thread