• 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: Month as Integer (or he's ranting again)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: Month as Integer (or he's ranting again)


  • Subject: re: Month as Integer (or he's ranting again)
  • From: "Jason W. Bruce" <email@hidden>
  • Date: Mon, 04 Dec 2000 11:02:39 -0600

Nigel Garvey stated in part:

> Not *any* "constant". You *can't* reassign values to months (Richard's
> implication that you can is what kicked off this sub-thread), nor to
> booleans or weekdays. Attempts to do so won't even compile (OS 8.6,
> Script Editor). These constants are, in fact, constant.
> . . . .
> "Constants" such as pi, tab, days, [etc.] seem to be scriptwide
> properties with default, compile time values. . . .

Hi Nigel,

I don't think you can use booleans as labels anywhere, but you can reassign
values to months, days, tab, and so-called constants if you place them in
records:

set foo to {December:December,tab:tab,monday:monday}
display dialog foo's December default answer ""
set foo's December to text returned of the result
display dialog foo's December -- displays whatever you entered

Records in AppleScript apparently have their own script context, and behave
like script objects. This means that you can use the same label in
different records in the same script, or the same label in a record and
elsewhere in a script -- even if the label is a so-called constant.

Jason Bruce


  • Prev by Date: Re:Quitting an applet?
  • Next by Date: Re: Finder's open event has properties? Cal?
  • Previous by thread: re: Month as Integer (or he's ranting again)
  • Next by thread: re: Month as Integer (or he's ranting again)
  • Index(es):
    • Date
    • Thread