Microsoft Small Basic

Program Listing: PDT387
TextWindow.Show()
TextWindow.WriteLine("Initalizing...")
GraphicsWindow.Show()
TextWindow.WriteLine("Setting font and color properties...")
GraphicsWindow.FontName = "Tahoma"
GraphicsWindow.BackgroundColor = "#000000"
GraphicsWindow.PenColor = "#FFFFFF"
GraphicsWindow.BrushColor = "#FFFFFF"
TextWindow.WriteLine("Drawing textbox...")
GraphicsWindow.DrawText(25, 25, "Please enter the filename of the audio you wish to play.")
GraphicsWindow.PenColor = "#000000"
GraphicsWindow.BrushColor = "#000000"
fn2enter = Controls.AddTextBox(25, 45)
TextWindow.WriteLine("Drawing buttons...")
GraphicsWindow.FontName = "Webdings"
bttnplay = Controls.AddButton("4", 25, 75)
bttnpause = Controls.AddButton(";", 50, 75)
bttnstop = Controls.AddButton("g", 75, 75)
TextWindow.WriteLine("Setting the width and height...")
GraphicsWindow.Width = 400
GraphicsWindow.Height = 135
TextWindow.WriteLine("Ready.")

begin:
Program.Delay(100)
GraphicsWindow.Title = filename
If Controls.LastClickedButton = bttnplay Then
filename = Controls.GetTextBoxText(fn2enter)
If filename = filenameubo Then
Else
TextWindow.Write("[")
TextWindow.Write(Clock.Time)
TextWindow.Write("] ")
TextWindow.Write("Loaded ")
TextWindow.Write(filename)
TextWindow.WriteLine("")
TextWindow.WriteLine("")
EndIf
filenameubo = Controls.GetTextBoxText(fn2enter)
Sound.Play(filename)
EndIf
If Controls.LastClickedButton = bttnpause Then
If filename = filenameubo Then
Sound.Pause(filename)
Else
Sound.Pause(filename)
Sound.Pause(filenameubo)
EndIf
EndIf
If Controls.LastClickedButton = bttnstop Then
If filename = filenameubo Then
Sound.Stop(filename)
Else
Sound.Stop(filename)
Sound.Stop(filenameubo)
EndIf
EndIf
Goto begin