Microsoft Small Basic

Program Listing:
Embed this in your website
' ALARM01.smallbasic - Alarm v0.1
icx = 18
icy = 26
itx = 60
ity = 100
sBGColor = "White"
sFGColor = "Black"
GraphicsWindow.FontSize = icy
GraphicsWindow.BrushColor = sFGColor
GraphicsWindow.BackgroundColor = sBGColor
GraphicsWindow.DrawText(icx * 3, icy * 10, "ALARM:")
tHour = Controls.AddTextBox(icx * 11, icy * 10)
GraphicsWindow.DrawText(icx * 21, icy * 10, ":")
tMin = Controls.AddTextBox(icx * 23, icy * 10)
Timer.Interval = 1000
Timer.Tick = OnTick
While "True"
  Program.Delay(500)
EndWhile

Sub OnTick
  iHour = Clock.Hour
  iMin = Clock.Minute
  iSec = Clock.Second
  iAHour = Controls.GetTextBoxText(tHour)
  iAMin = Controls.GetTextBoxText(tMin)
  If iHour < 10 Then
    sTime = "0" + iHour + ":"
  Else
    sTime = iHour + ":"
  EndIf
  If iMin < 10 Then
    sTime = sTime + "0" + iMin + ":"
  Else
    sTime = sTime + iMin + ":"
  EndIf
  If iSec < 10 Then
    sTime = sTime + "0" + iSec
  Else
    sTime = sTime + iSec
  EndIf
  GraphicsWindow.FontSize = ity
  GraphicsWindow.BrushColor = sBGColor
  GraphicsWindow.FillRectangle(itx * 1.4, ity, itx * 8, ity)
  GraphicsWindow.BrushColor = sFGColor
  GraphicsWindow.DrawText(itx * 1.4, ity - 3, sTime)
  If (iHour = iAHour) And (iMin = iAMin) Then
    Sound.PlayChimesAndWait()
  EndIf
EndSub
Copyright (c) Microsoft Corporation. All rights reserved.