• 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: (beep) as string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (beep) as string


  • Subject: Re: (beep) as string
  • From: Christopher Nebel <email@hidden>
  • Date: Tue, 18 Nov 2003 12:56:35 -0800

On Nov 17, 2003, at 2:51 AM, Nigel Garvey wrote:

"Fredo d;o)" posted this line in a script on bbs.applescript.net
yesterday:

display dialog "The required label does not exist..." & (beep) with icon 0

The non-result from (beep) is being concatenated onto a string, which
shouldn't be possible. It can also be concatenated *into* a string and
still work:

set msg to "The required label " & (beep) & "does not exist..."

It appears that a non-result from any call can be reliably coerced to an empty string, provided that it's done "in the same breath" (not via a result) ... Although it's very unconventional to use commands that don't return results as parameters to commands that don't need them, I'm not sure that any bug is involved here. Would anyone care to comment?

According to the language spec, it's a bug. I'll have to test with older versions, since I could have sworn that used to not work. If it turns out to have changed recently, then we'll see about fixing it in a small update; if it's always been that way, then we'll leave it alone.

However, I happen to agree with the "buggy" behavior. I expect to change AppleScript at some point to be not so fussy about "undefined" values -- Perl works this way, and it seems to work well for them.


--Chris Nebel
AppleScript Engineering
_______________________________________________
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: (beep) as string
      • From: "John W. Baxter" <email@hidden>
    • Re: (beep) as string
      • From: Walter Ian Kaye <email@hidden>
References: 
 >(beep) as string (From: Nigel Garvey <email@hidden>)

  • Prev by Date: files in toast window
  • Next by Date: Re: (beep) as string
  • Previous by thread: (beep) as string
  • Next by thread: Re: (beep) as string
  • Index(es):
    • Date
    • Thread