Announcing the time

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Announcing the time

Post by Mag » Wed Feb 26, 2014 11:06 am

Hi there!

In your experience, is this a good way to announcing the time?

Code: Select all

on mouseUp
   put "The time is" into a
   put the short system time into b
   revSpeak a && b
end mouseUp
Please, tell me your opinions! :oops:

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Announcing the time

Post by Mark » Wed Feb 26, 2014 11:43 am

Hi,

Sure, it is a nice way to tell the time. There are many ways to do it. Here's another one:

Code: Select all

constant dot = "."

on mouseUp
   put the english time into myTime
   put the last word of myTime into myDayPart
   delete the last word of myTime
   set the itemDel to colon
   if item 2 of myTime is "00" then
      revSpeak "The time is" && item 1 of myTime && "o'clock" && myDayPart & dot
   else
      revSpeak "The time is" && item 1 of myTime && "hours and" && item 2 of myTime && "minutes" && myDayPart & dot
   end if
end mouseUp
Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Announcing the time

Post by Mag » Wed Feb 26, 2014 12:48 pm

Thank you Mark, very nice way to tell the time!

Post Reply