rlinsurf Posted October 28, 2006 Posted October 28, 2006 (edited) 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, 2006 by Guest
jteich Posted October 28, 2006 Posted October 28, 2006 It is a bad idea to use this expression to get a time value, use Time ( hours ; minutes ; seconds ) instead -jens
rlinsurf Posted October 28, 2006 Author Posted October 28, 2006 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.
jteich Posted October 28, 2006 Posted October 28, 2006 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
comment Posted October 29, 2006 Posted October 29, 2006 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.
Recommended Posts
This topic is 6602 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now