* Program ....: DBASTIME.CMD
* Author  ....: Gary Conway
* Created ....: 02.07.86
* Updated ....: 
* Time .......: 
* Version ....: 1.0

SET TALK OFF
SET ECHO OFF
SET INTE OFF

*
*load HEX file with clock and menu routines
*

SET CALL TO 43000
LOAD DBASTIME.HEX

*
*point to results
*

STOR 43000 TO MENU
STOR 43003 TO CLOCK
STOR 43024 TO HOURS
STOR 43026 TO MINUTES
STOR 43028 TO MONTH
STOR 43030 TO DAY
STOR 43032 TO YEAR
STOR 43034 TO AMPM

*
*read clock
*
SET CALL TO 43003
CALL CLOCK

*
*use results to set system date
*

STOR CHR(PEEK(MONTH)) + CHR(PEEK(MONTH+1)) + '/' + CHR(PEEK(DAY)) + ;
	CHR(PEEK(DAY+1)) + '/'+ CHR(PEEK(YEAR)) + CHR(PEEK(YEAR+1)) TO ZZdate
SET DATE TO &ZZdate

*
*set time
*
STOR CHR(PEEK(HOURS)) + CHR(PEEK(HOURS+1)) + ':' + CHR(PEEK(MINUTES)) +;
	CHR(PEEK(MINUTES+1)) TO TIME

*
*am or pm
*

IF PEEK(43034) = 48
	STOR ' am' TO X
ELSE
	STOR ' pm' TO X
ENDI

*
*sample menu
*
	ERAS
	SET CALL TO 43000
	CALL MENU
	@ 2,10 SAY "- T I M E   T E S T  R O U T I N E -"
	@ 2,63 SAY "Date: "
	@ 2,69 SAY DATE() USING "##/##/##"
	@ 7,25 SAY "The Time is -> " + TIME + X
	@ 17,0

* EOF:DBASTIME.CMD
