Small Basic Tutorial: Creating Your First Program

Today we have a guest blogger: Noah Buscher! Check out Noah's first tutorial... about your first Small Basic program.

 

Small Basic is a .NET language created by Microsoft. It allows the beginner programmer to get started creating programs right away, and does not confuse the beginner with the numerous controls found in Visual Basic Express or Visual Studio. Officially, Small Basic is just a toned-down version of Visual Basic.NET. This means that once you are done learning Small Basic, you can easily learn Visual Basic. Let’s get started on your first program in Small Basic.

 
Step 1: Set Up Small Basic

Before you begin, be sure you have Small Basic downloaded and installed. After you are done installing, open up Small Basic, and you will see an editor like this:

 

 

This window is called the IDE, or Integrated Development Environment. This is where you will write, debug, and compile your code. This also includes a great feature called IntelliSense. This allows you to write code fast and easy. Please look at the image below to get an idea of what it looks like:

 

 

To use IntelliSense, just start typing! Take a look at all the commands available to get an idea of what Small Basic is capable of. For our first program, we are going to make a program that asks the user for a number, multiplies it by five, and displays the answer to them. Type:

 
TextWindow.WriteLine("What is the Number You Want to Multiply?")
userInput = TextWindow.ReadNumber()
answer = userInput * 5
TextWindow.WriteLine("The Answer is " + answer)

This program asks for the number to multiply, and stores the input in the variable userInput. Then it multiplies the number by five and stores that answer in the variable answer. Finally, it shows a message that displays the answer to the user.

 

Pretty cool, right? Try to modify the program to multiply the number by five and then add 5 to that answer.

 

Tutorial provided by Noah Buscher and Joman Mied.