Product Site

5.4.1.1. attachment

Returns the object that has been attached to the Alarm instance upon creation. Returns .nil if no object is attached.

See also method init.

Example 5.216. Alarm class — attachment method
oneSecond = .Alarm~new(1, .Target~new, "a second has passed")
call SysSleep 1.5                      -- give Alarm time to trigger
oneSecond~cancel

::class Target inherit AlarmNotification
::method triggered                     -- called when Alarm triggers
  use arg alarm
  say alarm~attachment                 -- displays "a second has passed"