on 2/17/07 1:49 PM, Tim Jones <[EMAIL PROTECTED]> wrote:
>
>>>
>>> I use a timer approach for a clock display in one of my apps and it
>>> doesn't use much CPU time at all.
>>
> [SNIP]
>> But I broke the part that runs the alarm. I'm putting the Alarm
>> Time into a
>> text field, AlarmTime:
>>
>> AlarmTime.text=theDate.shortdate+" "+theDate.shorttime
>>
>> But now, I need to compare that against
>>
>> d=new date
>>
>> Unfortunately, I don't know how to convert the text back to a date
>> to do the
>> comparison.
>
> Store the "theDate.TotalSeconds" value and continue to use the
> TotalSeconds from both "theDATE" and your new d date class.
Ah. Thanks, Tim :)
So now, that's working, but I have set up 3 timers to do the alarm.
TimeTimer, AlarmTimer, and DelayTimer.
TimeTimer goes like this:
if val(Format(d.totalseconds,
"##########"))>val(Format(theDate.totalseconds, "##########")) then
for x=0 to 5
AlarmTimer.enabled=true
next
DelayTimer.Enabled=true
end if
AlarmTimer is:
Dim d as Date
Dim x as integer
d=new date
speak "The time is now " +d.shorttime +". Please wake up!"
me.enabled=false
And DelayTimer:
dim x as integer
for x=0 to 5
AlarmTimer.enabled=true
next
me.enabled=false
The period of TimeTimer is 1000, AlarmTimer is 60000, and DelayTimer is
300000.
The idea is to test if we have passed the Alarm Time, and Speak a phrase,
once every minute for 5 minutes. Then it should delay for another 5 minutes,
then repeat speaking the phrase once a minute for 5 minutes again. Then
stop.
I think this looks pretty convoluted to do this. And it doesn't seem to
work...
All My Best,
Jeffrey
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>