October 28, 200619 yr Hello, All }:| I have tried to make a little test app for FMP's realtime functioning. It's an Alarm Clock. I have 4 fields called Hour(Number, Global), Min(Number, Global), Sec(Number, Global), and Count (Number, Global). I then set each field to the Hour, Minutes and Seconds for which I want the Alarm to sound. Say: 01, 24, 45. I then have the following script: Set Field [ AlarmClock::Count; 0] Loop Exit Loop If [Get ( CurrentTime ) ≥ GetAsTime ( AlarmClock::Hour & ":" & AlarmClock::Min & ":" & AlarmClock::Min)] End Loop Loop Set Field [AlarmClock::Count; AlarmClock::Count + 1] Exit Loop If [ AlarmClock::Count = 10 ] Beep End Loop This script never succeeds, but just runs endlessly. I'm obviously missing a basic principle of working with Time fields. Can someone tell me why this isn't working? Thanks again : All My Best, Jeffrey Edited October 28, 200619 yr by Guest
October 28, 200619 yr It is a bad idea to use this expression to get a time value, use Time ( hours ; minutes ; seconds ) instead -jens
October 28, 200619 yr Author That's what I tried first. The only problem there as I see it, is that Time doesn't specifically refer to the current time, but to any amount of time. So when it failed, I figured that was why and switched to GetAsTime.
October 28, 200619 yr I didn't make my point clear enough. It should be Time ( AlarmClock::Hour ; AlarmClock::Min ; AlarmClock::Sec) instead of GetAsTime ( AlarmClock::Hour & ":" & AlarmClock::Min & ":" & AlarmClock::Min)] Get( CurrentTime ) remains untouched. -jens
October 29, 200619 yr The Time() function IS more appropriate here. Nevertheless, it should work with GetAsTime() as well, so that's not the reason why it failed. Is it possible that it did NOT fail? Your original post mistakenly uses minutes instead of seconds.
Create an account or sign in to comment