Microsoft Small Basic

Program Listing: MFC568
'################'
'Type & Tell (v1.0)
'Graphics Challenge 1
'Sep/2012
'by GoToLoop
'################'

'http://social.msdn.microsoft.com/Forums/en-US/smallbasic
'/thread/88d814da-7691-4103-9785-6886f5cb9105

'_____________________________________________________________________________'
BS = Text.GetCharacter( 8) ' Backspace
ESC = Text.GetCharacter(27) ' Escape Key

Tell()

GraphicsWindow.Title = "Type & Tell"
GraphicsWindow.BackgroundColor = "Black"

GraphicsWindow.TextInput = Type
'_____________________________________________________________________________'
Sub Tell

GraphicsWindow.BrushColor = "Yellow"
GraphicsWindow.FontBold = "True"
GraphicsWindow.FontSize = 16

text = ""
tell = Shapes.AddText(text)

EndSub
'_____________________________________________________________________________'
Sub Type

type = GraphicsWindow.LastText

Sound.PlayClick()

If type = ESC Then
Program.End()
ElseIf type = BS Then
If text <> "" Then
text = Text.GetSubText( text 1,Text.GetLength(text) - 1 )
EndIf
Else
text = text + type
EndIf

Shapes.SetText(tell,text)

EndSub
'_____________________________________________________________________________'