• 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: Dual Purpose Applet Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dual Purpose Applet Question


  • Subject: Re: Dual Purpose Applet Question
  • From: Paul Berkowitz <email@hidden>
  • Date: Tue, 05 Dec 2000 11:44:04 -0800

On 12/5/00 11:26 AM, "Mr Tea" <email@hidden> wrote:

> set theName to (day of (current date) as string) & " " &
> (characters 1 thru 3 of (month of (current date) as string) as string)
> & " " & (year of (current date) as string) & " - " & time string of (current
date)


Now, if anyone can suggest a neater way of setting 'theName'...

A string operand on the left of the concatenation operator "&" coerces the
operand on the right to string if possible. Also "text 1 thru x" is better
and quicker than "characters 1 thru x" (which is a list, then coerced to a
string). And don't keep evaluating 4 times over: do it once and set it as a
variable. So, what is effectively the same as what you have, but "neater":

set cd to (current date)
set theName to "" & (day of cd) & " " & (text 1 thru 3 of ("" & (month
of cd))) & " " & (year of cd) & " - " & time string of cd
-- "5 Dec 2000 - 11:38:01 AM"


Or, even neater, use Akua Sweets:

set theName to the clock using form "%d %nm %c%y - %T"


--
Paul Berkowitz


  • Follow-Ups:
    • Re: Dual Purpose Applet Question
      • From: Mr Tea <email@hidden>
References: 
 >Re: Dual Purpose Applet Question (From: Mr Tea <email@hidden>)

  • Prev by Date: Re: Re: Dual Purpose Applet Question
  • Next by Date: Re: he's ranting again (Was: Re: Month as Integer (or he's ranting again))
  • Previous by thread: Re: Dual Purpose Applet Question
  • Next by thread: Re: Dual Purpose Applet Question
  • Index(es):
    • Date
    • Thread