Click here to Skip to main content
15,867,308 members
Articles / Programming Languages / Basic

Getting Started With Microsoft Small Basic For Beginners

Rate me:
Please Sign up or sign in to vote.
3.10/5 (4 votes)
1 Dec 2015CPOL8 min read 32K   171   2   3
In this article you will learn about Microsoft Small Basic for beginners.

Introduction

Microsoft always makes the programming environment better and easy. Now, there is a new addition for programming learners that is called Small Basic. Small Basic is for any beginners who wants to learn programming. The new Small Basic IDE is similarl to MS Paint, which makes programmers to work and enjoy learning. I still remember my school days when I was in my high school. During our computer class, the teacher used to ask to start with MS Paint. By using MS paint, we started learning how to use mouse, etc. Now, I can say instead of teaching MS Paint to any new user we can ask them to Start with Small Basic, Yes, Small Basic will be easy for any new person who is working on computer for the first time or who don’t know any programming language and want to start learning programming.

Any person who want to start learning programs, the good time is to start with Small Basic instead of starting from C ,C#,VB.NET or C++. For many people who start learning any language like C,C++ ,C# and etc, found it hard to understand all the basics. Without understanding the basics it will be hard for them to write a good program. Now no need to worry for that, since Small Basic is here for all of them. 

I can strongly say that if anyone want to start learning programming for the first time they should start with Small Basic. They will surely easily understand what is IDE and Editor and how to run a program, how to write their own logic of program within couple of days. Later, they can easily learn any language as they wish for like C++, C#, etc.

Why I recommend Small Basic for Beginners who want to learn Programming?

  • Simple and Easy
  • Small Basic IDE is similar to MS Paint which makes beginners to learn with fun.
  • Even Middle School Students can understand easily.

How to install Small Basic

You can download the Small Basic from the following link:

Here is a TechNet Wiki Article which has all the links to start learning Small Basic.

http://social.technet.microsoft.com/wiki/contents/articles/17553.wiki-small-basic-portal.aspx

 

Installation Steps

After downloading Small basic from the above link install it on your computer.

Image 1

Click Next and Install Microsoft Small Basic.

Image 2

Finally click on Install Button which will install the Small Basic on your computer.

Using the code

After installation you can find the Small Basic Icon,

Image 3

<bri" style="outline: none 0px;">Click and open Microsoft Small Basic.

When we open Small Basic for the first time we can see the Development Environment with the following 3 parts:
  1. Tool Bar: Simple and easy to understandable by any user as this has only New, Open, Save, Save As, Cut, Copy, Paste and Run.
  2. Editor: Here we write our Programs (This looks similar to Notepad).
  3. Help Window: Which will display our programming commands.

Image 4

Our First Small Basic Program (For Output)

Let’s create a simple program to display our Name as output. It will be always fun to see our name to be displayed from our first program. I still remember my high school days as I was so happy to see my name to be displayed from C Language using printf().

Now let’s see how to write our first program to display our Name from Small Basic.

The Output is to display any text or value from our program. As we all know, Program is nothing but a set of instructions. Using one of the Instruction we can display our output. 

To display the Output from Small Basic we will be using the following,

TextWindow.WriteLine(“your output text”); 

As I have told Small Basic Development Environment is much easier for any new developer who learn programming for the first time. When you type text in editor, you can see a small window which will display all the text starting from text (This are all the instructions to perform our programming result).

Image 5

Here, we are using TextWindow.WriteLine(); to display out first output. To display the output we use the WritLine() and to read the Input from the user we will use the Read(). Here WriteLine() and Read()are called as a function, which means this two Read() and WritelLine() will have some set of Instruction which will execute our text and display or get the text from users.

Image 6

Now let’s display our Name.

VB.NET
TextWindow.WriteLine("My Name is SHANU.Welcome to My first Program")

You can copy this code and paste in your Small Basic Editor. Note “SHANU” is my name, so you have to change it to your name.

Yes now we have written our first program to display our name so what is next. Now we need to run the program and view our Output.
To run the program we can press F5 from keyboard or we can click on the Run from the Tool Window.

Image 7

So here is our first program output. I can feel how much you are happy while seeing your successful message. To close the output window you can press any key. Here all the output is based on Console so in next tutorial we will see about graphical window output.

Save the Program

You have successfully created your first program. Now you need to save the program so that you can use later and also you can modify the same program with more functionality. To save the program from Toolbar you can see the Save Icon click on that and save the program to your selected folder for easy access. 

Image 8

The program will be saved as “.sb” extention.

Image 9

If we run our program we can see in the same folder with few more files like “.dll” and “.exe” extension files. We can also run directly by clicking the “.exe” file. Here “.exe” is an executable file.

Image 10

Open the Saved Program

To open the existing saved file we can click on Open icon from the toolbar in Small Basic. Go to the path where you have saved your program. Select the “.sb” extension file and click open.

Image 11

Our First Small Basic Program (For Input/output using Variable)

So you have successfully created your simple program to display your name as output. Now let’s see how to give input to your program and display the output of your input.

So what is the use of getting Input. Now for example you want to write a program where others can give their name as input and you need to display the user entered Name with welcome message. To perform this we need to store the name entered by user temporarily to the computer. Here we use variable to store the input. The variables will reside in computer memory temporarily till we close our program.

In this example program let us see how to store our name to variable and display the output from our program.

VB.NET
TextWindow.WriteLine("My Name is SHANU.Welcome to My first Program")  
TextWindow.WriteLine("What is your Name")  
myname=TextWindow.Read()  
TextWindow.WriteLine("welcome " + myname) 

Copy the above code and paste in your editor.

Image 12

  1. Here we can see first I displayed my name with welcome message.
  2. In second line I asked the user ”What is your Name”.
  3. In third line we can see I have used the variable “myname” and storing the user input to this variable.
  4. To get the user input here we use TextWindow.Read() (For output we use WriteLine() and to get the input here we use Read()).
  5. Here we print the result with welcome message.

When we run the program first it will look like the following, 

Image 13

Here we can see first it displayed our name and then ask to give the input as “What is your Name”. Now user can give the input in the empty line. Here I have given the name of my son as “Afraz”.

Image 14

After entering the name when user press any key the output with user name and welcome message will get displayed.

Image 15

Now we have successfully created our program to read input and print the output.

Simple Program to display Background and font with colors

So far in above program the console windows were displaying the output in black and white. Now let’s add colors for background of text and give some colors for the font.

VB.NET
TextWindow.BackgroundColor="yellow"  
TextWindow.ForegroundColor="blue"  
TextWindow.WriteLine("wow now it looks cool with colors")  

Copy the above code and paste in your editor.

Image 16

For background color we use the following,

VB.NET
TextWindow.BackgroundColor="yellow"  


We can give any Small Basic supported color as we like.

For Font color we use the following,

VB.NET
TextWindow.ForegroundColor="blue"  


We can give any Small Basic supported color as we like.

Now we give some text output and press F5 or click on the Run button from the Toolbar. We can see the final output with cool color as output in our console window.

Image 17

Program to Add 2 Numbers

Now let’s create a simple program to get two numbers as input from user and add both the numbers and display the calculated result to user. Here 
we use the colors to display the output as colorful.

In this program I have also commented each line of code with its use.

Comment is an important part of programming .Program is write once and used many times. If we follow to write comment on code then it will be useful for any other program who are using our program. Even for us in future it will be more useful as why we had created this line in this program.

To add comment for each line in program we use single quotes '. Note we add the Single quotes ' then the text inside the quotes will be in green color to differentiate as this is a comment.

This program needs any explanation as I have commented in each line with its uses. I have used all our above 3 programs and made one program as this has output, input and colors.

VB.NET
TextWindow.BackgroundColor="yellow" ' Background Color as Yellow  
TextWindow.ForegroundColor="darkgreen" 'Font Color as Yellow  
TextWindow.WriteLine("Welcome to simple Addition program") 'Welcome Msg  
TextWindow.WriteLine("Enter your First Number") 'Ask user to enter first number  
TextWindow.BackgroundColor="cyan" 'Back color for first input  
TextWindow.ForegroundColor="blue" 'Font color for first input  
number1=TextWindow.Read() ' read the user input and store in number1 variable  
TextWindow.BackgroundColor="yellow" 'Back color   
TextWindow.ForegroundColor="darkgreen" 'Font color  
TextWindow.WriteLine("Enter your Second Number") 'Ask user to enter Second number  
TextWindow.BackgroundColor="cyan" 'Back color   
TextWindow.ForegroundColor="blue" 'Font color  
number2=TextWindow.Read() ' read the user input and store in number2 variable  
Calculation=number1+number2 'Add both number1 and number2 store the result in Calculation  
TextWindow.BackgroundColor="yellow" 'Back color   
TextWindow.ForegroundColor="red" 'Back color   
TextWindow.WriteLine("The result is " + Calculation) ' Display the final result  

Copy the above code and paste in your editor,

Image 18

Run the program

Give your input as number for first and second number and then check the calculated result. Here for example I have given the first number input as 12 and second number input as 8 and so the calculated result you can see in the output.

Image 19

History

Programs.zif - 2015-12-01

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader
India India
Microsoft MVP | Code Project MVP | CSharp Corner MVP | Author | Blogger and always happy to Share what he knows to others. MyBlog

My Interview on Microsoft TechNet Wiki Ninja Link

Comments and Discussions

 
GeneralSmall Basic Portal Moved Pin
Frank Turscak2-Dec-15 14:02
Frank Turscak2-Dec-15 14:02 
GeneralRe: Small Basic Portal Moved Pin
syed shanu2-Dec-15 14:20
mvasyed shanu2-Dec-15 14:20 
QuestionHave you consider to post this as a tip? Pin
Nelek2-Dec-15 0:18
protectorNelek2-Dec-15 0:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.