/* GUIBEGIN WINDOW , 21, 89, 249, 38, POPUP|CAPTION|SYSMENU|MINBOX|MAXBOX|THICK, , Time Count FONT 8, 400, MS Shell Dlg TEXT 4, 6, 245, 8, GROUP, , SecDisplay, , Time lapsed = 0:0:0 TIMER 1000 DEND GUIEND */ /* This script counts off elapsed time. The window contains a TIMER control set * to time-out every 1000 milliseconds (ie, every second). We simply keep track * of the elapsed seconds/minutes/hours, and display them in a TEXT control. */ OPTIONS "C_CALL LABELCHECK" LIBRARY rexxgui GuiErr = "SYNTAX" GuiHeading = 1 GuiCreateWindow('NORMAL') Hours = 0 Minutes = 0 Seconds = 0 Again: DO FOREVER GuiGetMsg() CATCH SYNTAX CONDITION('M') SIGNAL Again CATCH HALT FINALLY GuiDestroyWindow() END RETURN /* Called by Reginald when a time-out happens for our window. */ WM_TIMER: /* Increment the number of seconds that have passed. */ Seconds = Seconds + 1 /* If Seconds has rolled over, increment the minute. */ IF Seconds > 59 THEN DO Minutes = Minutes + 1 Seconds = 0 END /* If Minutes has rolled over, increment the hour. */ IF Minutes > 59 THEN DO Hours = Hours + 1 Minutes = 0 END /* Display the time */ GuiAddCtlText("SecDisplay", "Time lapsed =" Hours || ":" || Minutes || ":" || Seconds) /* Don't let Rexx Gui process this event. So, the time-outs continue. */ RETURN ""