Alarm for a future time
atime.
At this time, the Alarm sends message
triggered to the specified
notification target.
AlarmNotification class, or a
Message object
(as the Message class inherits from
AlarmNotification).
If target is a
Message object, the
triggered
method
of the Message class will respond by simply sending the
specified message.
DateTime object, it specifies the time when the
alarm will be triggered.
The specified time must be in the future.
TimeSpan, the Alarm
will be set to the current time plus the specified time span.
The time span must not be a negative interval.
String, you can specify this as a date and
time (hh:mm:ss)
or as a number of seconds starting at the present time.
If you use the date and time format, you can specify
a date in the default format (dd Mmm yyyy)
after the time with a single blank separating the time and date.
Leading and trailing whitespace characters are not allowed in the atime.
If you do not specify a date, the Alarm uses the first
future occurrence of the specified time.
cancel to
the specified notification target.
/* Alarm Examples */
PersonalMessage = .MyMessageClass~new("Call the Bank")
msg = .Message~new(PersonalMessage, "RemindMe")
time = .DateTime~fromIsoDate("2017-12-15T17:10:00.000000")
a = .Alarm~new(time, msg)
exit
::class MyMessageClass public
::method init
expose inmsg
use arg inmsg
::method RemindMe
expose inmsg
say "It is now" time("C")". Please" inmsg
/* On the specified data and time, displays the following message: */
/* "It is now 5:10pm. Please Call the Bank" */
a = .Alarm~new(30, msg)