Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Events.Alarm.SetRelativeOffset

Sets a relative offset from an event start date to fire an alarm.

Component Version macOS Windows Linux Server iOS SDK
Events 6.2 ✅ Yes ❌ No ❌ No ❌ No ✅ Yes
MBS( "Events.Alarm.SetRelativeOffset"; EKAlarm; TimeOffset )   More

Parameters

Parameter Description Example
EKAlarm The reference to the alarm. $Alarm
TimeOffset The relative time offset in seconds. -15*60

Result

Returns OK or error.

Description

Sets a relative offset from an event start date to fire an alarm.
Set this property to an appropriate negative value to establish an alarm trigger relative to the start date/time of an event. Setting this clears any existing date trigger.
Value is in seconds.

Examples

Add an alaram with relative offset:

Set Variable [ $alarm ; Value: MBS( "Events.NewAlarm" ) ]
If [ not IsEmpty(Test::AlarmSound) ]
    Set Variable [ $r ; Value: MBS( "Events.Alarm.SetSound"; $alarm; Test::AlarmSound ) ]
End If
If [ not IsEmpty(Test::AlarmLocationTitle) ]
    Set Variable [ $l ; Value: MBS( "Events.StructuredLocation.NewLocationWithTitle"; Test::AlarmLocationTitle ) ]
    Set Variable [ $r ; Value: MBS( "Events.StructuredLocation.SetRadius"; $l; Test::AlarmLocationRadius ) ]
    Set Variable [ $r ; Value: MBS( "Events.StructuredLocation.SetGeoLocation"; $l; Test::AlarmLocationGeoLat; Test::AlarmLocationGeoLong ) ]
    Set Variable [ $r ; Value: MBS( "Events.Alarm.SetStructuredLocation"; $alarm; $l) ]
    Set Variable [ $r ; Value: MBS( "Events.Alarm.SetProximity"; $alarm; Test::AlarmProximity ) ]
End If
# e.g. AlarmRelativeOffsetSeconds contains -9 * 60
Set Variable [ $r ; Value: MBS( "Events.Alarm.SetRelativeOffset"; $alarm; Evaluate( Test::AlarmRelativeOffsetSeconds ) ) ]
Set Variable [ $r ; Value: MBS( "Events.Item.AddAlarm"; $item; $alarm ) ]

See also

This function checks for a license.

Created 10th March 2016, last changed 23th March 2020


Events.Alarm.SetProximity - Events.Alarm.SetSound