• 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
Booleans in positional parameter sub routines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Booleans in positional parameter sub routines


  • Subject: Booleans in positional parameter sub routines
  • From: Sun Real <email@hidden>
  • Date: Mon, 18 Dec 2000 10:01:24 +1100

Trying to use the above, I came across this:

to doSomething with noise -- works
if noise then beep
end doSomething

to doSomething with noise -- execution error: "The variable noise is
not defined."
set a to 1
if noise then beep
end doSomething

to doSomething with noise -- works
noise
set a to 1
if noise then beep
end doSomething

It also works if I log 'noise', or declare it as a local.

Is this how it's suppsed to work? What's the preferred method for
dealing with it, so that it might be clear to someone else down the
track? Declare it as a local?

Cheers.

Richard

-- Great Lies of the Music Business: "Your name is at the door"


  • Prev by Date: Re: Can someone explain this?
  • Next by Date: Re: Can someone explain this?
  • Previous by thread: Re: applescript-users digest, Vol 2 #141 - 12 msgs
  • Next by thread: Re: Booleans in positional parameter sub routines
  • Index(es):
    • Date
    • Thread