DIRECTORY Commander USING [CommandProc, Register], IO USING[PutRope, STREAM], MyClock USING [curPacked, PaintMe], Process USING [Detach, Pause, SecondsToTicks], ReminderDefs, ReminderDefsPrivate USING [itIsNow, EnterEventMinder], Rope USING[ROPE, Equal], Runtime USING [IsBound], Tempus USING [defaultTime, MakeRope, Packed, Parse] ; ReminderUtilImpl: CEDAR MONITOR IMPORTS Commander, IO, Runtime, Process, Rope, Tempus, ReminderDefsPrivate, MyClock SHARES ReminderDefsPrivate, MyClock = BEGIN PretendIts: Commander.CommandProc = TRUSTED { -- for debugging t: Tempus.Packed = Tempus.Parse[cmd.commandLine, ReminderDefsPrivate.itIsNow].time; IF Runtime.IsBound[MyClock.PaintMe] THEN MyClock.curPacked _ t; ReminderDefsPrivate.EnterEventMinder[[t + 1]]; -- + 1 so you can say remember .. at noon, then pretendits noon to see it get fired off IF Runtime.IsBound[MyClock.PaintMe] THEN Process.Detach[FORK LeaveItUpForAWhile[]]; cmd.out.PutRope[Tempus.MakeRope[time: t, includeDayOfWeek: TRUE]]; }; howLong: LONG CARDINAL _ 5; LeaveItUpForAWhile: PROCEDURE = TRUSTED { Process.Pause[Process.SecondsToTicks[howLong]]; MyClock.curPacked _ Tempus.defaultTime; }; ItIsNow: Commander.CommandProc = { -- for debugging IF Rope.Equal[cmd.commandLine, "\n"] THEN { ReminderDefsPrivate.itIsNow _ Tempus.defaultTime; cmd.out.PutRope["{current time}"]; } ELSE { t: Tempus.Packed = Tempus.Parse[cmd.commandLine, ReminderDefsPrivate.itIsNow].time; ReminderDefsPrivate.itIsNow _ [t + 1]; -- + 1 so you can say remember .. at noon, then pretendits noon to see it get fired off cmd.out.PutRope[Tempus.MakeRope[time: t, includeDayOfWeek: TRUE]]; }; }; Commander.Register["PretendIts", PretendIts, "Pretend its ... for purposes of posting a reminder. (A temporary change.)"]; Commander.Register["ItIsNow", ItIsNow, "Pretend its ... for purposes of registration as well as posting a reminder. (A permanent change, i.e. must explicitly be restored by typing ItIsNow{cr})"]; END. ¦ReminderImpl.mesa. See Reminder.Tioga for documentation and examples of how to use the new reminder package. Last Edited by: Teitelman, May 27, 1983 12:41 pm Êí˜J™lJ™0J™šÏk ˜ Jšœ œ˜(Jšœœ œ˜Jšœœ˜#Jšœœ!˜.Jšœ ˜ Jšœœ˜6Jšœœœ ˜Jšœœ ˜Jšœœ'˜3Jšœ˜J˜—J˜šÐlnœœ˜J˜—J˜Jšœ œ@˜UJ˜Jšœ˜#J˜šœœ˜ J˜—šÏn œœÏc˜?JšœS˜SJšœ"œ˜?Jšœ. X˜†Jšœ"œœ˜SJšœ;œ˜BJ˜—J˜JšŸœœœ˜J˜šŸœ œœ˜*J˜/Jšœ'˜'J˜—J˜šŸœ ˜4šœ#œ˜+Jšœ1˜1Jšœ"˜"J˜—šœ˜JšœS˜SJšœ& X˜~Jšœ;œ˜BJšœ˜—J˜—J˜J˜zJ˜˜Ã˜J˜——J˜Jšœ˜J˜J˜—…—¼ O