Microsoft Small Basic

Program Listing: RPZ841
' Sample Code for TextWindow Object

' Properties and 0perations for the text window ----------
TextWindow.Title = "Sample Code for TextWindow Object"
x = TextWindow.Left
TextWindow.WriteLine("TextWindow.Left=" + x)
y = TextWindow.Top
TextWindow.WriteLine("TextWindow.Top=" + y)
Program.Delay(2000)
TextWindow.Hide()
Program.Delay(2000)
TextWindow.Show()

' Operations for pause ----------
TextWindow.WriteLine("TextWindow.Pause()")
TextWindow.Pause()
TextWindow.WriteLine("TextWindow.PauseIfVisible()")
TextWindow.PauseIfVisible()
TextWindow.WriteLine("TextWindow.PauseWithoutMessage()")
TextWindow.PauseWithoutMessage()

' Properties and 0peration for the color ----------
TextWindow.BackgroundColor = "Gray"
TextWindow.ForegroundColor = "Black"
TextWindow.Clear()

' Properties for the cusror ----------
col = TextWindow.CursorLeft
TextWindow.WriteLine("TextWindow.CursorLeft=" + col)
row = TextWindow.CursorTop
TextWindow.WriteLine("TextWindow.CursorTop=" + row)
TextWindow.CursorLeft = 0
TextWindow.CursorTop = 3

' Operations for input/output text ----------
TextWindow.Write("Text? ")
txt = TextWindow.Read()
TextWindow.Write("Number? ")
num = TextWindow.ReadNumber()
TextWindow.Write("Text=" + txt + ",")
TextWindow.WriteLine("Number=" + num)