OpenVMS Source-Code Demos

TIMER_DEMO_EASY.BAS

1000	%title "basic-timer-demo-easy_xxx.bas"					!
	%ident                      "version 100.1"				! <<<---+---
	declare string constant k_version = "100.1"			,	! <<<---+	&
				k_program = "basic-timer-demo-(easy)"		!
	!=======================================================================
	! title  : basic-timer-demo-easy.bas
	! author : Neil Rieck ( http://www3.sympatico.ca/n.rieck/ )
	! created: 2010-04-08
	! ver who when     what
	! --- --- -------- -----------------------------------------------------
	! 100 NSR 20100408 1. original program (the easy way)
	!=======================================================================
	option type=explicit							!
	%include "starlet"      %from %library "sys$library:basic$starlet"	! system services
	%include "$ssdef"       %from %library "sys$library:basic$starlet"	! ss$
	%include "lib$routines" %from %library "sys$library:basic$starlet"	! lib$wait etc.
	%include "$libdef"      %from %library "sys$library:basic$starlet"	! eg. lib$_normal
	%include "$libwaitdef"  %from %library "sys$library:basic$starlet"	! eg. $LIB$K_VAX_F
	!
	declare long		rc%			,&
		single		delay
	!=======================================================================
	!	main
	!=======================================================================
	main:
	print k_program +"_"+ k_version						!
	print string$(len(k_program +"_"+ k_version), asc("="))			!
	!
	delay = 0.1								!
	gosub delay_nsr								!
	!
	delay = 0.75								!
	gosub delay_nsr								!
	!
	delay = 0.9								!
	gosub delay_nsr								!
	!
	goto fini								!
	!-----------------------------------------------------------------------
	!	delay_nsr
	!-----------------------------------------------------------------------
	delay_nsr:								!
	print	"starting "+					&
		edit$( format$(delay, "########.##"), 2)+	&
		" second delay"
	!
	rc% = lib$wait(delay,,LIB$K_VAX_F)					!
	if rc% <> lib$_normal then						!
	    print "-e-lib$wait: "+ str$(rc%)					!
	else									!
	    print "wake"							!
	end if									!
	return									!
	!=======================================================================
	!	that's all folks
	!=======================================================================
	fini:									!
	end									!

Back to OpenVMS
Back to OpenVMS Demo Index
Back to Home
Neil Rieck
Kitchener - Waterloo - Cambridge, Ontario, Canada.