• 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: Null
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Null


  • Subject: Re: Null
  • From: John Stewart <email@hidden>
  • Date: Thu, 9 Jan 2003 13:06:59 -0500

On Thursday, Jan 9, 2003, at 03:47 America/New_York, Gary Lists wrote:

On or about 1/8/03 3:50 PM, Christopher Nebel wrote:

The upshot of this is that "null" is indeed a defined identifier in
AppleScript, but I don't think it means anything useful -- there's no
implementation behind it. "missing value" is the thing to use in
scripts.

To help me (and others...?) get things straight, I've seen some scripts
(Paul B, I think) that use something like:

property myvar : missing value

In what way should we be using that as an initial value, and what is the
logical operator for comparison of that variable?

if myvar = missing value -- this?

Yes.missing value is a constant defined by AppleScript itself, compiling the above property declaration should show you this.

if myvar = "missing value" -- proably not

No, in this case myvar contains a string value comprised of the words "missing" and "value" i.e. it isn't a missing value.

if myvar is undefined -- whoa

By definition - the act of defining something as missing value means it is not undefined. You could just as easily use an empty string or any other value you like. In other words, missing value is a convenience for scripters that shows the value isn't defined as something specific.

Throw us a bone here, someone.

property somevar : missing value
if somevar = missing value then
set somevar to text returned of (display dialog "Enter anything:" default answer "")
else
display dialog "Thrown Bone" buttons {"-"} default button 1
end if

John
_______________________________________________
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.

References: 
 >Re: Null (From: Gary Lists <email@hidden>)

  • Prev by Date: Re: Getting screen resolution the Safari way
  • Next by Date: Re: Reading input from a delimited source file
  • Previous by thread: Re: Null
  • Next by thread: Re: Null
  • Index(es):
    • Date
    • Thread