Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Alarm Clock

Featured Replies

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 by Guest

It is a bad idea to use this expression to get a time value, use

Time ( hours ; minutes ; seconds )

instead

-jens

  • 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.

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

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

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.