'===========================================================================
' Subject: ALARM CLOCK                        Date: 01-05-01 (15:53)       
'  Author: Kenneth Green                      Code: ASIC                   
'  Origin: green1729@earthlink.net          Packet: ASIC.ABC
'===========================================================================
menu:
cls
print "          Alarm   By Ken Green"
if hour=0 then noset:
print "Alarm Set To:"
print "Hour:";
print hour
print "Minute:";
print minute
noset:
print "       (1) Set Alarm"
print "       (2) Help"
print "       (3) Quit"
print "       Type 1,2, or 3."
go:
n$=inkey$
if n$="1" then setalarm:
if n$="2" then help:
if n$="3" then done:
a$=time$


h$=left$(a$,2)
m$=mid$(a$,4,2)
s$=right$(a$,2)
s=val(s$)
h=val(h$)
m=val(m$)
if h=13 then
h=1
endif
if h=14 then
h=2
endif
if h=15 then
h=3
endif
if h=16 then
h=4
endif
if h=17 then
h=5
endif
if h=18 then
h=6
endif
if h=19 then
h=7
endif
if h=20 then
h=8
endif
if h=21 then
h=9
endif
if h=22 then
h=10
endif
if h=23 then
h=11
endif
if h=0 then
h=12
endif
REM Clock
locate 12,10
print "Hour"
locate 13,10
print "****"
locate 14,7
print h
locate 15,10
print "Minute"
locate 16,10
print "******"
locate 17,7
print m
locate 18,10
print "Second"
locate 19,10
print "******"
locate 20,7
print s
if h=hour then
if m=minute then
if bp<>1 then
locate 11,10
print "<<<<<<<<<<<   A L A R M   >>>>>>>>>>>>>"
BEEP
locate 10,10
print "Hit the space bar to stop sound!!!"
if n$=" " then
bp=1
locate 11,10
print "                                              "
locate 10,10
print "                                              "
endif
endif
else
bp=0
endif
endif

goto go:
setalarm:
locate 11,10
print "                                                "
locate 11,0
print "                  "
locate 10,0
print "Hour (1 to 12): ";
input hour$
print "Minute (0 to 59): ";
input minute$
hour=val(hour$)
minute=val(minute$)
if hour>12 then setalarm:
if minute>59 then setalarm:
goto menu:
help:
cls
print "            Alarm Help"
print "Important: Read this and immediately go back to the menu if you have"
print "the alarm set. It will not go off in this window."
print "To Set Alarm:"
print "Type the 2 key on the keyboard then at the Hour prompt,"
print "type a number representing the hour, from 1 to 12."
print "Do not type AM or PM. This program will work for both times."
print "Then at the Minute prompt, type the minute, from 0 to 59."
print "Now the program is set to make beep sounds at that time."
print "It will keep beeping for 1 minute unless you type"
print "anything from the menu or hit the space bar."
print "You can leave this program running in the Windows toolbar"
print "and it will keep running."
print
print "You might need a sound card and speakers for the beep sound,"
print "I haven't tested it without one. Although it might work with"
print "the computer's internal speaker without it. Go ahead and test it"
print "if you don't have this, but I cannot guarantee it."
print
print "Press enter to go back to the menu.";
input men$
goto menu:
done:
cls
