Guidance
指路人
g.yi.org
Software / Reginald / Examples / seccount.rex

Register 
新用户注册
Search 搜索
首页 
Home Home
Software
Upload

  
/*
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.
 */

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 ""
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2017-6-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2010-07-16 20:45:19