SmallBasicLibrary API

Array Clock Controls Desktop Dictionary
File Flickr GraphicsWindow ImageList Math
Mouse Network Program Shapes Sound
Stack Text TextWindow Timer Turtle

Array
This object provides a way of storing more than one value for a given name. These values can be accessed by another index.

ContainsIndex ContainsValue GetAllIndices
GetItemCount GetValue IsArray
RemoveValue SetValue

ContainsIndex(array,index)
Gets whether or not the array contains the specified index. This is very useful when deciding if the array's index was initialized by some value or not.
array The array to check.
index The index to check.
returns "True" or "False" depending on if the index was present in the specified.
array.


ContainsValue(array,value)
Gets whether or not the array contains the specified value. This is very useful when deciding if the array's value was stored in some index.
array The array to check.
value The value to check.
returns "True" or "False" depending on if the value was present in the specified.
array.


GetAllIndices(array)
Gets all the indices for the array, as another array.
array The array whose indices are requested.
returns An array filled with all the indices of the specified array. The index of the returned array starts from 1.

GetItemCount(array)
Gets the number of items stored in the array.
array The array for which the count is requested.
returns The number of items in the specified array.

GetValue(arrayName,index)
Gets a value for a given array and index.
arrayName The name of the array.
index The name of the index.
returns The value at the specified index of the specified array.

IsArray(array)
Gets whether or not a given variable is an array.
array The variable to check.
returns "True" if the specified variable is an array. "False" otherwise.

RemoveValue(arrayName,index)
Removes the array item at the specified index.
arrayName The name of the array.
index The index of the item to remove.

SetValue(arrayName,index,value)
Sets a value for a given array and index.
arrayName The name of the array.
index Name of the index.
value The value to set.

Clock
This class provides access to the system clock

Date Day ElapsedMilliseconds
Hour Millisecond Minute
Month Second Time
WeekDay Year

Date
Gets the current system date.

Day
Gets the current day of the month.

ElapsedMilliseconds
Gets the number of milliseconds that have elapsed since 1900.

Hour
Gets the current Hour.

Millisecond
Gets the current Millisecond.

Minute
Gets the current Minute.

Month
Gets the current Month.

Second
Gets the current Second.

Time
Gets the current system time.

WeekDay
Gets the current day of the week.

Year
Gets the current year.

Controls
The Controls object allows you to add, move and interact with controls.

AddButton AddMultiLineTextBox AddTextBox
ButtonClicked GetButtonCaption GetTextBoxText
HideControl LastClickedButton LastTypedTextBox
Move Remove SetButtonCaption
SetSize SetTextBoxText ShowControl
TextTyped

AddButton(caption,left,top)
Adds a button to the graphics window with the specified width and height.
caption The caption to display in the button.
left The x co-ordinate of the button.
top The y co-ordinate of the button.
returns The button that was just added to the Graphics Window.

AddMultiLineTextBox(left,top)
Adds a multi-line text input box to the graphics window with the specified width and height.
left The x co-ordinate of the text box.
top The y co-ordinate of the text box.
returns The text box that was just added to the Graphics Window.

AddTextBox(left,top)
Adds a text input box to the graphics window with the specified width and height.
left The x co-ordinate of the text box.
top The y co-ordinate of the text box.
returns The text box that was just added to the Graphics Window.

ButtonClicked
Raises an event when any button control is clicked.

GetButtonCaption(buttonName)
Gets the current caption of the specified button.
buttonName The Button whose caption is requested.
returns The current caption of the button.

GetTextBoxText(textBoxName)
Gets the current text of the specified TextBox.
textBoxName The TextBox whose text is requested.
returns The text in the TextBox

HideControl(controlName)
Hides an already added control.
controlName The name of the control.

LastClickedButton
Gets the last Button that was clicked on the Graphics Window.

LastTypedTextBox
Gets the last TextBox, text was typed into.

Move(control,x,y)
Moves the control with the specified name to a new position.
control The name of the control to move.
x The x co-ordinate of the new position.
y The y co-ordinate of the new position.

Remove(controlName)
Removes a control from the Graphics Window.
controlName The name of the control that needs to be removed.

SetButtonCaption(buttonName,caption)
Sets the caption of the specified button.
buttonName The Button whose caption needs to be set.
caption The new caption for the button.

SetSize(control,width,height)
Sets the size of the control.
control The name of the control to be resized.
width The width of the control.
height The height of the control.

SetTextBoxText(textBoxName,text)
Sets the text of the specified TextBox.
textBoxName The TextBox whose text needs to be set.
text The new text for the TextBox.

ShowControl(controlName)
Shows a previously hidden control.
controlName The name of the control.

TextTyped
Raises an event when text is typed into any TextBox control.

Desktop
This class provides methods to interact with the desktop.

Height SetWallPaper Width

Height
Gets the screen height of the primary desktop.

SetWallPaper(fileOrUrl)
Sets the specified picture as the desktop's wallpaper. This file could be a local file or a network file or even an Internet URL.
fileOrUrl The filename or URL of the picture.

Width
Gets the screen width of the primary desktop.

Dictionary
This class provides access to an online Dictionary service.

GetDefinition GetDefinitionInFrench

GetDefinition(word)
Gets the definition of a word, in English.
word The word to define.
returns The definition(s) of the specified word.

GetDefinitionInFrench(word)
Gets the definition of a word, in French.
word The word to define.
returns The definition(s) of the specified word.

File
The File object provides methods to access, read and write information from and to a file on disk. Using this object, it is possible to save and open settings across multiple sessions of your program.

AppendContents CopyFile CreateDirectory
DeleteDirectory DeleteFile GetDirectories
GetFiles GetSettingsFilePath GetTemporaryFilePath
InsertLine LastError ReadContents
ReadLine WriteContents WriteLine

AppendContents(filePath,contents)
para Opens the specified file and appends the contents to the end of the file.
filePath para The full path of the file to read from. An example of a full path will be c:\temp\settings.data.
contents The contents to append to the end of the file.
returns para If the operation was successful, this will return "SUCCESS". Otherwise, it will return "FAILED".

CopyFile(sourceFilePath,destinationFilePath)
para Copies the specified source file to the destination file path. If the destination points to a location that doesn't exist, the method will attempt to create it automatically.
para Existing files will be overwritten. It is always best to check if the destination file exists if you don't want to overwrite existing files.
sourceFilePath para The full path of the file that needs to be copied. An example of a full path will be c:\temp\settings.data.
destinationFilePath The destination location or the file path.
returns If the operation was successful, this will return "SUCCESS". Otherwise, it will return "FAILED".

CreateDirectory(directoryPath)
Creates the specified directory.
directoryPath The full path of the directory to be created.
returns If the operation was successful, this will return "SUCCESS". Otherwise, it will return "FAILED".

DeleteDirectory(directoryPath)
Deletes the specified directory.
directoryPath The full path of the directory to be deleted.
returns If the operation was successful, this will return "SUCCESS". Otherwise, it will return "FAILED".

DeleteFile(filePath)
Deletes the specified file.
filePath para The destination location or the file path. An example of a full path will be
c:\temp\settings.data.

returns If the operation was successful, this will return "SUCCESS". Otherwise, it will return "FAILED".

GetDirectories(directoryPath)
Gets the path of all the directories in the specified directory path.
directoryPath The directory to look for subdirectories.
returns If the operation was successful, this will return the list of directories as an array. Otherwise, it will return "FAILED".

GetFiles(directoryPath)
Gets the path of all the files in the specified directory path.
directoryPath The directory to look for files.
returns If the operation was successful, this will return the files as an array. Otherwise, it will return "FAILED".

GetSettingsFilePath()
para Gets the full path of the settings file for this program. The settings file name is based on the program's name and is present in the same location as the program.
returns The full path of the settings file specific for this program.

GetTemporaryFilePath()
para Creates a new temporary file in a temporary directory and returns the
full file path.

returns The full file path of the temporary file.

InsertLine(filePath,lineNumber,contents)
para Opens the specified file and inserts the contents at the specified line number.
para This operation will not overwrite any existing content at the specified line.
filePath para The full path of the file to read from. An example of a full path will be c:\temp\settings.data.
lineNumber The line number of the text to insert.
contents The contents to insert into the file.
returns para If the operation was successful, this will return "SUCCESS". Otherwise, it will return "FAILED".

LastError
para Gets or sets the last encountered file operation based error message. This property is useful for finding out when some method fails to execute.

ReadContents(filePath)
para Opens a file and reads the entire file's contents. This method will be fast for small files that are less than an MB in size, but will start to slow down and will be noticeable for files greater than 10MB.
filePath para The full path of the file to read. An example of a full path will be c:\temp\settings.data.
returns The entire contents of the file.

ReadLine(filePath,lineNumber)
Opens the specified file and reads the contents at the specified line number.
filePath para The full path of the file to read from. An example of a full path will be c:\temp\settings.data.
lineNumber The line number of the text to be read.
returns The text at the specified line of the specified file.

WriteContents(filePath,contents)
para Opens a file and writes the specified contents into it, replacing the original contents with the new content.
filePath para The full path of the file to write to. An example of a full path will be c:\temp\settings.data.
contents The contents to write into the specified file.
returns para If the operation was successful, this will return "SUCCESS". Otherwise, it will return "FAILED".

WriteLine(filePath,lineNumber,contents)
para Opens the specified file and write the contents at the specified line number.
para This operation will overwrite any existing content at the specified line.
filePath para The full path of the file to read from. An example of a full path will be c:\temp\settings.data.
lineNumber The line number of the text to write.
contents para The contents to write at the specified line of the specified file.
returns para If the operation was successful, this will return "SUCCESS". Otherwise, it will return "FAILED".

Flickr
This class provides access to Flickr photo services.

GetPictureOfMoment GetRandomPicture

GetPictureOfMoment()
Gets the URL for the picture of the moment.
returns A file URL for Flickr's picture of the moment

GetRandomPicture(tag)
Gets the URL for a random picture tagged with the specified tag.
tag The tag for the requested picture.
returns A file URL for Flickr's random picture

GraphicsWindow
The GraphicsWindow provides graphics related input and output functionality. For example, using this class, it is possible to draw and fill circles and rectangles.

BackgroundColor BrushColor CanResize
Clear DrawBoundText DrawEllipse
DrawImage DrawLine DrawRectangle
DrawResizedImage DrawText DrawTriangle
FillEllipse FillRectangle FillTriangle
FontBold FontItalic FontName
FontSize GetColorFromRGB GetPixel
GetRandomColor Height Hide
KeyDown KeyUp LastKey
LastText Left MouseDown
MouseMove MouseUp MouseX
MouseY PenColor PenWidth
SetPixel Show ShowMessage
TextInput Title Top
Width

BackgroundColor
Gets or sets the Background color of the Graphics Window.

BrushColor
Gets or sets the brush color to be used to fill shapes drawn on the Graphics Window.

CanResize
Specifies whether or not the Graphics Window can be resized by the user.

Clear()
Clears the window.

DrawBoundText(x,y,width,text)
Draws a line of text on the screen at the specified location.
x The x co-ordinate of the text start point.
y The y co-ordinate of the text start point.
width The maximum available width. This parameter helps define when the text should wrap.
text The text to draw.

DrawEllipse(x,y,width,height)
Draws an ellipse on the screen using the selected Pen.
x The x co-ordinate of the ellipse.
y The y co-ordinate of the ellipse.
width The width of the ellipse.
height The height of the ellipse.

DrawImage(imageName,x,y)
Draws the specified image from memory on to the screen.
imageName The name of the image to draw.
x The x co-ordinate of the point to draw the image at.
y The y co-ordinate of the point to draw the image at.

DrawLine(x1,y1,x2,y2)
Draws a line from one point to another.
x1 The x co-ordinate of the first point.
y1 The y co-ordinate of the first point.
x2 The x co-ordinate of the second point.
y2 The y co-ordinate of the second point.

DrawRectangle(x,y,width,height)
Draws a rectangle on the screen using the selected Pen.
x The x co-ordinate of the rectangle.
y The y co-ordinate of the rectangle.
width The width of the rectangle.
height The height of the rectangle.

DrawResizedImage(imageName,x,y,width,height)
Draws the specified image from memory on to the screen, in the specified size.
imageName The name of the image to draw
x The x co-ordinate of the point to draw the image at.
y The y co-ordinate of the point to draw the image at.
width The width to draw the image.
height The height to draw the image.

DrawText(x,y,text)
Draws a line of text on the screen at the specified location.
x The x co-ordinate of the text start point.
y The y co-ordinate of the text start point.
text The text to draw

DrawTriangle(x1,y1,x2,y2,x3,y3)
Draws a triangle on the screen using the selected pen.
x1 The x co-ordinate of the first point.
y1 The y co-ordinate of the first point.
x2 The x co-ordinate of the second point.
y2 The y co-ordinate of the second point.
x3 The x co-ordinate of the third point.
y3 The y co-ordinate of the third point.

FillEllipse(x,y,width,height)
Fills an ellipse on the screen using the selected Brush.
x The x co-ordinate of the ellipse.
y The y co-ordinate of the ellipse.
width The width of the ellipse.
height The height of the ellipse.

FillRectangle(x,y,width,height)
Fills a rectangle on the screen using the selected Brush.
x The x co-ordinate of the rectangle.
y The y co-ordinate of the rectangle.
width The width of the rectangle.
height The height of the rectangle.

FillTriangle(x1,y1,x2,y2,x3,y3)
Draws and fills a triangle on the screen using the selected brush.
x1 The x co-ordinate of the first point.
y1 The y co-ordinate of the first point.
x2 The x co-ordinate of the second point.
y2 The y co-ordinate of the second point.
x3 The x co-ordinate of the third point.
y3 The y co-ordinate of the third point.

FontBold
Gets or sets whether or not the font to be used when drawing text on the Graphics Window, is bold.

FontItalic
Gets or sets whether or not the font to be used when drawing text on the Graphics Window, is italic.

FontName
Gets or sets the Font Name to be used when drawing text on the Graphics Window.

FontSize
Gets or sets the Font Size to be used when drawing text on the Graphics Window.

GetColorFromRGB(red,green,blue)
Constructs a color given the Red, Green and Blue values.
red The red component of the Color (0-255).
green The green component of the color (0-255).
blue The blue component of the color (0-255).
returns Returns a color that can be used to set the brush or pen color.

GetPixel(x,y)
Gets the color of the pixel at the specified x and y co-ordinates.
x The x co-ordinate of the pixel.
y The y co-ordinate of the pixel.
returns The color of the pixel.

GetRandomColor()
Gets a valid random color.
returns A valid random color.

Height
Gets or sets the Height of the graphics window.

Hide()
Hides the Graphics window.

KeyDown
Raises an event when a key is pressed down on the keyboard.

KeyUp
Raises an event when a key is released on the keyboard.

LastKey
Gets the last key that was pressed or released.

LastText
Gets the last text that was entered on the Graphics Window.

Left
Gets or sets the Left Position of the graphics window.

MouseDown
Raises an event when the mouse button is clicked down.

MouseMove
Raises an event when the mouse is moved around.

MouseUp
Raises an event when the mouse button is released.

MouseX
Gets the x-position of the mouse relative to the Graphics Window.

MouseY
Gets the y-position of the mouse relative to the Graphics Window.

PenColor
Gets or sets the color of the pen used to draw shapes on the Graphics Window.

PenWidth
Gets or sets the width of the pen used to draw shapes on the Graphics Window.

SetPixel(x,y,color)
Draws the pixel specified by the x and y co-ordinates using the specified color.
x The x co-ordinate of the pixel.
y The y co-ordinate of the pixel.
color The color of the pixel to set.

Show()
Shows the Graphics window to enable interactions with it.

ShowMessage(text,title)
Displays a message box to the user.
text The text to be displayed on the message box.
title The title for the message box.

TextInput
Raises an event when text is entered on the GraphicsWindow.

Title
Gets or sets the title for the graphics window.

Top
Gets or sets the Top Position of the graphics window.

Width
Gets or sets the Width of the graphics window.

ImageList
This class helps to load and store images in memory.

GetHeightOfImage GetWidthOfImage LoadImage

GetHeightOfImage(imageName)
Gets the height of the stored image.
imageName The name of the image in memory.
returns The height of the specified image.

GetWidthOfImage(imageName)
Gets the width of the stored image.
imageName The name of the image in memory.
returns The width of the specified image.

LoadImage(fileNameOrUrl)
Loads an image from a file or the Internet into memory.
fileNameOrUrl The file name to load the image from. This could be a local file or a URL to the Internet location.
returns Returns the name of the image that was loaded.

Math
The Math class provides lots of useful mathematics related methods

Abs ArcCos ArcSin
ArcTan Ceiling Cos
Floor GetDegrees GetRadians
GetRandomNumber Log Max
Min NaturalLog Pi
Power Remainder Round
Sin SquareRoot Tan

Abs(number)
Gets the absolute value of the given number. For example, -32.233 will return 32.233.
number The number to get the absolute value for.
returns The absolute value of the given number.

ArcCos(cosValue)
Gets the angle in radians, given the cosine value.
cosValue The cosine value whose angle is needed.
returns The angle (in radians) for the given cosine Value.

ArcSin(sinValue)
Gets the angle in radians, given the sin value.
sinValue The sine value whose angle is needed.
returns The angle (in radians) for the given sine Value.

ArcTan(tanValue)
Gets the angle in radians, given the tangent value.
tanValue The tangent value whose angle is needed.
returns The angle (in radians) for the given tangent Value.

Ceiling(number)
Gets an integer that is greater than or equal to the specified decimal number. For example,
32.233 will return 33.

number The number whose ceiling is required.
returns The ceiling value of the given number.

Cos(angle)
Gets the cosine of the given angle in radians.
angle The angle whose cosine is needed (in radians).
returns The cosine of the given angle.

Floor(number)
Gets an integer that is less than or equal to the specified decimal number. For example,
32.233 will return 32.

number The number whose floor value is required.
returns The floor value of the given number.

GetDegrees(angle)
Converts a given angle in radians to degrees.
angle The angle in radians.
returns The converted angle in degrees.

GetRadians(angle)
Converts a given angle in degrees to radians.
angle The angle in degrees.
returns The converted angle in radians.

GetRandomNumber(maxNumber)
Gets a random number between 1 and the specified maxNumber (inclusive).
maxNumber The maximum number for the requested random value.
returns A Random number that is less than or equal to the specified max.

Log(number)
Gets the logarithm (base 10) value of the given number.
number The number whose logarithm value is required
returns The log value of the given number

Max(number1,number2)
Compares two numbers and returns the greater of the two.
number1 The first of the two numbers to compare.
number2 The second of the two numbers to compare.
returns The greater value of the two numbers.

Min(number1,number2)
Compares two numbers and returns the smaller of the two.
number1 The first of the two numbers to compare.
number2 The second of the two numbers to compare.
returns The smaller value of the two numbers.

NaturalLog(number)
Gets the natural logarithm value of the given number.
number The number whose natural logarithm value is required.
returns The natural log value of the given number.

Pi
Gets the value of Pi

Power(baseNumber,exponent)
Raises the base number to the specified power.
baseNumber The number to be raised to the exponent power.
exponent The power to raise the base number.
returns The base number raised to the specified exponent.

Remainder(dividend,divisor)
Divides the first number by the second and returns the remainder.
dividend The number to divide.
divisor The number that divides.
returns The remainder after the division.

Round(number)
Rounds a given number to the nearest integer. For example 32.233 will be rounded to 32.0 while
32.566 will be rounded to 33.

number The number whose approximation is required.
returns The rounded value of the given number.

Sin(angle)
Gets the sine of the given angle in radians.
angle The angle whose sine is needed (in radians)
returns The sine of the given angle

SquareRoot(number)
Gets the square root of a given number.
number The number whose square root value is needed.
returns The square root value of the given number.

Tan(angle)
Gets the tangent of the given angle in radians.
angle The angle whose tangent is needed (in radians).
returns The tangent of the given angle.

Mouse
The mouse class provides accessors to get or set the mouse related properties, like the cursor position, pointer, etc.

HideCursor IsLeftButtonDown IsRightButtonDown
MouseX MouseY ShowCursor

HideCursor()
Hides the mouse cursor on the screen.

IsLeftButtonDown
Gets whether or not the left button is pressed.

IsRightButtonDown
Gets whether or not the right button is pressed.

MouseX
Gets or sets the mouse cursor's x co-ordinate.

MouseY
Gets or sets the mouse cursor's y co-ordinate.

ShowCursor()
Shows the mouse cursors on the screen.

Network
This private helper class provides network access methods

DownloadFile GetWebPageContents

DownloadFile(url)
Downloads a file from the network to a local temporary file.
url The URL of the file on the network.
returns A local file name that the remote file was downloaded as.

GetWebPageContents(url)
Gets the contents of a specified web page.
url The URL of the web page
returns The contents of the specified web page.

Program
The Program class provides helpers to control the program execution.

ArgumentCount Delay Directory
End GetArgument

ArgumentCount
Gets the number of command-line arguments passed to this program.

Delay(milliSeconds)
Delays program execution by the specified amount of MilliSeconds.
milliSeconds The amount of delay.

Directory
Gets the executing program's directory.

End()
Ends the program.

GetArgument(index)
Returns the specified argument passed to this program.
index Index of the argument.
returns The command-line argument at the specified index.

Shapes
The Shape object allows you to add, move and rotate shapes to the Graphics window.

AddEllipse AddImage AddLine
AddRectangle AddText AddTriangle
Animate GetLeft GetOpacity
GetTop HideShape Move
Remove Rotate SetOpacity
SetText ShowShape Zoom

AddEllipse(width,height)
Adds an ellipse shape with the specified width and height.
width The width of the ellipse shape.
height The height of the ellipse shape.
returns The Ellipse shape that was just added to the Graphics Window.

AddImage(imageName)
Adds an image as a shape that can be moved, animated or rotated.
imageName The name of the image to draw.
returns The image that was just added to the Graphics Window.

AddLine(x1,y1,x2,y2)
Adds a line between the specified points.
x1 The x co-ordinate of the first point.
y1 The y co-ordinate of the first point.
x2 The x co-ordinate of the second point.
y2 The y co-ordinate of the second point.
returns The line that was just added to the Graphics Window.

AddRectangle(width,height)
Adds a rectangle shape with the specified width and height.
width The width of the rectangle shape.
height The height of the rectangle shape.
returns The Rectangle shape that was just added to the Graphics Window.

AddText(text)
Adds some text as a shape that can be moved, animated or rotated.
text The text to add.
returns The text shape that was just added to the Graphics Window.

AddTriangle(x1,y1,x2,y2,x3,y3)
Adds a triangle shape represented by the specified points.
x1 The x co-ordinate of the first point.
y1 The y co-ordinate of the first point.
x2 The x co-ordinate of the second point.
y2 The y co-ordinate of the second point.
x3 The x co-ordinate of the third point.
y3 The y co-ordinate of the third point.
returns The Triangle shape that was just added to the Graphics Window.

Animate(shapeName,x,y,duration)
Animates a shape with the specified name to a new position.
shapeName The name of the shape to move.
x The x co-ordinate of the new position.
y The y co-ordinate of the new position.
duration The time for the animation, in milliseconds.

GetLeft(shapeName)
Gets the left co-ordinate of the specified shape.
shapeName The name of the shape.
returns The left co-ordinate of the shape.

GetOpacity(shapeName)
Gets the opacity of a shape.
shapeName The name of the shape.
returns The opacity of the object as a value between 0 and 100. 0 is completely transparent and 100 is completely opaque.

GetTop(shapeName)
Gets the top co-ordinate of the specified shape.
shapeName The name of the shape.
returns The top co-ordinate of the shape.

HideShape(shapeName)
Hides an already added shape.
shapeName The name of the shape.

Move(shapeName,x,y)
Moves the shape with the specified name to a new position.
shapeName The name of the shape to move.
x The x co-ordinate of the new position.
y The y co-ordinate of the new position.

Remove(shapeName)
Removes a shape from the Graphics Window.
shapeName The name of the shape that needs to be removed.

Rotate(shapeName,angle)
Rotates the shape with the specified name to the specified angle.
shapeName The name of the shape to rotate.
angle The angle to rotate the shape.

SetOpacity(shapeName,level)
Sets how opaque a shape should render.
shapeName The name of the shape.
level The opacity level ranging from 0 to 100. 0 is completely transparent and 100 is completely opaque.

SetText(shapeName,text)
Sets the text of a text shape.
shapeName The name of the text shape.
text The new text value to set.

ShowShape(shapeName)
Shows a previously hidden shape.
shapeName The name of the shape.

Zoom(shapeName,scaleX,scaleY)
Scales the shape using the specified zoom levels. Minimum is 0.1 and maximum is 20.
shapeName The name of the shape to zoom.
scaleX The x-axis zoom level.
scaleY The y-axis zoom level.

Sound
The Sound object provides operations that allow the playback of sounds. Some sample sounds are provided along with the library.

Pause Play PlayAndWait
PlayBellRing PlayBellRingAndWait PlayChime
PlayChimeAndWait PlayChimes PlayChimesAndWait
PlayClick PlayClickAndWait PlayMusic
Stop

Pause(filePath)
Pauses playback of an audio file. If the file was not already playing, this operation will not do anything.
filePath The path for the audio file. This could either be a local file (e.g.: c:\music\track1.mp3) or a file on the network (e.g.: http://contoso.com/track01.wma).

Play(filePath)
para Plays an audio file. This could be an mp3 or wav or wma file. Other file formats may or may not play depending on the audio codecs installed on the user's computer.
para If the file was already paused, this operation will resume from the position where the playback was paused.
filePath The path for the audio file. This could either be a local file (e.g.: c:\music\track1.mp3) or a file on the network (e.g.: http://contoso.com/track01.wma).

PlayAndWait(filePath)
para Plays an audio file and waits until it is finished playing. This could be an mp3 or wav or wma file. Other file formats may or may not play depending on the audio codecs installed on the user's computer.
para If the file was already paused, this operation will resume from the position where the playback was paused.
filePath The path for the audio file. This could either be a local file (e.g.: c:\music\track1.mp3) or a file on the network (e.g.: http://contoso.com/track01.wma).

PlayBellRing()
Plays the Bell Ring Sound.

PlayBellRingAndWait()
Plays the Bell Ring Sound and waits for it to finish.

PlayChime()
Plays the Chime Sound.

PlayChimeAndWait()
Plays the Chime Sound and waits for it to finish.

PlayChimes()
Plays the Chimes Sound.

PlayChimesAndWait()
Plays the Chimes Sound and waits for it to finish.

PlayClick()
Plays the Click Sound.

PlayClickAndWait()
Plays the Click Sound and waits for it to finish.

PlayMusic(notes)
Plays musical notes.
notes A set of musical notes to play. The format is a subset of the Music Markup Language supported by QBasic.
example code Sound.PlayMusic("O5 C8 C8 G8 G8 A8 A8 G4 F8 F8 E8 E8 D8 D8 C4")

Stop(filePath)
Stops playback of an audio file. If the file was not already playing, this operation will not do anything.
filePath The path for the audio file. This could either be a local file (e.g.: c:\music\track1.mp3) or a file on the network (e.g.: http://contoso.com/track01.wma).

Stack
This object provides a way of storing values just like stacking up a plate. You can push a value to the top of the stack and pop it off. You can only pop the values one by one off the stack and the last pushed value will be the first one to pop out.

GetCount PopValue PushValue

GetCount(stackName)
Gets the count of items in the specified stack.
stackName The name of the stack.
returns The number of items in the specified stack.

PopValue(stackName)
Pops the value from the specified stack.
stackName The name of the stack.
returns The value from the stack.

PushValue(stackName,value)
Pushes a value to the specified stack.
stackName The name of the stack.
value The value to push.

Text
The Text object provides helpful operations for working with Text.

Append ConvertToLowerCase ConvertToUpperCase
EndsWith GetCharacter GetCharacterCode
GetIndexOf GetLength GetSubText
GetSubTextToEnd IsSubText StartsWith

Append(text1,text2)
Appends two text inputs and returns the result as another text. This operation is particularly useful when dealing with unknown text in variables which could accidentally be treated as numbers and get added, instead of getting appended.
text1 First part of the text to be appended.
text2 Second part of the text to be appended.
returns The appended text containing both the specified parts.

ConvertToLowerCase(text)
Converts the given text to lower case.
text The text to convert to lower case.
returns The lower case version of the given text.

ConvertToUpperCase(text)
Converts the given text to upper case.
text The text to convert to upper case.
returns The upper case version of the given text.

EndsWith(text,subText)
Gets whether or not a given text ends with the specified subText.
text The larger text to search within.
subText The sub-text to search for.
returns True if the subtext was found at the end of the given text.

GetCharacter(characterCode)
Given the Unicode character code, gets the corresponding character, which can then be used with regular text.
characterCode The character code (Unicode based) for the required character.
returns A Unicode character that corresponds to the code specified.

GetCharacterCode(character)
Given a Unicode character, gets the corresponding character code.
character The character whose code is requested.
returns A Unicode based code that corresponds to the character specified.

GetIndexOf(text,subText)
Finds the position where a sub-text appears in the specified text.
text The text to search in.
subText The text to search for.
returns The position at which the sub-text appears in the specified text. If the text doesn't appear, it returns 0.

GetLength(text)
Gets the length of the given text.
text The text whose length is needed.
returns The length of the given text.

GetSubText(text,start,length)
Gets a sub-text from the given text.
text The text to derive the sub-text from.
start Specifies where to start from.
length Specifies the length of the sub text.
returns The requested sub-text

GetSubTextToEnd(text,start)
Gets a sub-text from the given text from a specified position to the end.
text The text to derive the sub-text from.
start Specifies where to start from.
returns The requested sub-text.

IsSubText(text,subText)
Gets whether or not a given subText is a subset of the larger text.
text The larger text within which the sub-text will be searched.
subText The sub-text to search for.
returns True if the subtext was found within the given text.

StartsWith(text,subText)
Gets whether or not a given text starts with the specified subText.
text The larger text to search within.
subText The sub-text to search for.
returns True if the subtext was found at the start of the given text.

TextWindow
The TextWindow provides text-related input and output functionalities. For example using this class, it is possible to write or read some text or number to and from the text-based text window.

BackgroundColor Clear CursorLeft
CursorTop ForegroundColor Hide
Left Pause PauseIfVisible
PauseWithoutMessage Read ReadKey
ReadNumber Show Title
Top VerifyAccess Write
WriteLine

BackgroundColor
Gets or sets the background color of the text to be output in the text window.

Clear()
Clears the TextWindow.

CursorLeft
Gets or sets the cursor's column position on the text window.

CursorTop
Gets or sets the cursor's row position on the text window.

ForegroundColor
Gets or sets the foreground color of the text to be output in the text window.

Hide()
Hides the text window.

Left
Gets or sets the Left position of the Text Window.

Pause()
Waits for user input before returning.

PauseIfVisible()
Waits for user input only when the TextWindow is already open.

PauseWithoutMessage()
Waits for user input before returning.

Read()
Reads a line of text from the text window. This function will not return until the user hits ENTER.
returns The text that was read from the text window

ReadKey()
Reads a single character from the text window.
returns The character that was read from the text window.

ReadNumber()
Reads a number from the text window. This function will not return until the user hits ENTER.
returns The number that was read from the text window

Show()
Shows the Text window to enable interactions with it.

Title
Gets or sets the Title for the text window.

Top
Gets or sets the Top position of the Text Window.

VerifyAccess()
Verifies if the access to text Window has been made yet

Write(data)
Writes text or number to the text window. Unlike WriteLine, this will not append a new line character, which means, anything written to the text window after this call will be on the same line.
data The text or number to write to the text window

WriteLine(data)
Writes text or number to the text window. A new line character will be appended to the output, so that the next time something is written to the text window, it will go in a new line.
data The text or number to write to the text window.

Timer
The Timer object provides an easy way for doing something repeatedly with a constant interval between.

Interval Pause Resume
Tick

Interval
Gets or sets the interval (in milliseconds) specifying how often the timer should raise the Tick event. This value can range from 10 to 100000000

Pause()
Pauses the timer. Tick events will not be raised.

Resume()
Resumes the timer from a paused state. Tick events will now be raised.

Tick
Raises an event when the timer ticks.

Turtle
The Turtle provides Logo-like functionality to draw shapes by manipulating the properties of a pen and drawing primitives.

Angle Hide Move
MoveTo PenDown PenUp
Show Speed Turn
TurnLeft TurnRight X
Y

Angle
Gets or sets the current angle of the turtle. While setting, this will turn the turtle instantly to the new angle.

Hide()
Hides the Turtle and disables interactions with it.

Move(distance)
Moves the turtle to a specified distance. If the pen is down, it will draw a line as it moves.
distance The distance to move the turtle.

MoveTo(x,y)
Turns and moves the turtle to the specified location. If the pen is down, it will draw a line as it moves.
x The x co-ordinate of the destination point.
y The y co-ordinate of the destination point.

PenDown()
Sets the pen down to enable the turtle to draw as it moves.

PenUp()
Lifts the pen up to stop drawing as the turtle moves.

Show()
Shows the Turtle to enable interactions with it.

Speed
Specifies how fast the turtle should move. Valid values are 1 to 10. If Speed is set to 10, the turtle moves and rotates instantly.

Turn(angle)
Turns the turtle by the specified angle. Angle is in degrees and can be either positive or negative. If the angle is positive, the turtle turns to its right. If it is negative, the turtle turns to its left.
angle The angle to turn the turtle.

TurnLeft()
Turns the turtle 90 degrees to the left.

TurnRight()
Turns the turtle 90 degrees to the right.

X
Gets or sets the X location of the Turtle. While setting, this will move the turtle instantly to the new location.

Y
Gets or sets the Y location of the Turtle. While setting, this will move the turtle instantly to the new location.