• 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
Non Compulsory Parameters & a Null Constant ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Non Compulsory Parameters & a Null Constant ?


  • Subject: Non Compulsory Parameters & a Null Constant ?
  • From: Adam Hinshaw <email@hidden>
  • Date: Wed, 12 Feb 2003 15:10:55 +1100

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.

eg;
on getFoo(bar)
(*do stuff*)
end

set myVar to getFoo(12) -- current way

but what if i did not want to pass a param as my handler will use a default
value instead or respond in a different manner,

eg;
set myVar to getFoo() -- gets a runtime error "...doesn't match the
parameters"

So is there away around these errors.

Seems like it is quite strict in a C sense of requiring values / Doesn't
make sense considering how loose every thing else is.

---

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.

eg,

on getFoo(bar)
if bar equals NULL then
set bar to 0
end if
end



thanks
adam.
_______________________________________________
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.

  • Follow-Ups:
    • Re: Non Compulsory Parameters & a Null Constant ?
      • From: Paul Skinner <email@hidden>
    • Re: Non Compulsory Parameters & a Null Constant ?
      • From: Michelle Steiner <email@hidden>
References: 
 >Re: on "do shell script" (From: Chris Janton <email@hidden>)

  • Prev by Date: Re: on "do shell script"
  • Next by Date: Re: Non Compulsory Parameters & a Null Constant ?
  • Previous by thread: Re: on "do shell script"
  • Next by thread: Re: Non Compulsory Parameters & a Null Constant ?
  • Index(es):
    • Date
    • Thread