Simple clear advice in plain English

Write your own simple software

Can’t find a program for your computer that does what you need it to? We explain how to make one yourself with this simple programming tool

Create your own programs image of robot
Discover how to use Microsoft's Small Basic to create programs

Computer programming tends to evoke images of professionals working for companies such as Microsoft but, in reality, lots of software is made by individuals. Programming can also be handy if you ever want to tweak a macro in Word or help with some maths homework. But it’s often hard to get started.

For that reason, we will explain how to use Small Basic, a simple tool made by Microsoft that allows you to create programs. It will also teach you concepts that will prove essential if you go on to more complicated projects.

Getting Small Basic
You can download Small Basic from the Computeractive website. You will need the Microsoft .NET Framework 3.5 installed on your computer for Small Basic to work – if your computer reports that this is missing, get a copy free from Microsoft. Once both are installed, you are ready to get started.

When you create your first program it’s traditional to write one that says ‘Hello World’, so let’s try this first. Click the Start button, All Programs, Small Basic and then Microsoft Small Basic. This will open the Small Basic Window. There is a toolbar at the top and an area for writing the code, which is white and says Untitled in the title bar. There is a blue column on the right-hand side of the window. This displays help about commands as you write them.

Left-click inside the white text area. There is a small ‘1’ in the grey margin – like many other programming languages, Small Basic numbers the lines in a program as this makes it easier to track problems. Type the following line:

TextWindow.WriteLine(“Hello World!”)

As you might have already guessed, this line of code tells the computer to write one line – ‘Hello World!’ in a text window. Click on the Run button or press F5 to see it in action, and as promised another window appears with the text “Hello World! Press any key to continue” inside it. Press any key to close the program and return to Small Basic.

Small Basic helps you write code in two ways. Firstly, it suggests commands as you type in a list that appears underneath the cursor. So, if you start to type a command you will see options appear – if you know the one you want, use the up and down arrow keys to move through the options and choose it. This makes typing code quicker, and cuts down on mistyping errors.

Secondly, it colours text to show what Small Basic thinks the text is. This is useful when tracking down problems. For example, let’s deliberately add another line to the program that includes an error to show how Small Basic will help fix it. Enter the following code on line two:

TextWindow“WriteLine(“Hello Mum!”)

You will notice that the colours used to display this line look different to the one above. Click on the Blue Run arrow and instead of the text window of the preview example, an error message will appear at the bottom of the text entry window. In this case it says “Sorry, we found some errors… 2,11: Unrecognised statement encountered.”

This found the error we deliberately put into that line. The first number, 2, tells you which line of the program contains the error, and the second shows how many letters along it lies.

Hopefully you have noticed that this is because there is a quotation mark (“) where there should be a full stop. Correct this, and you will see that the colours in that line match the ones from the line above - a good sign that it’s ready to go. Press F5 to run the program.

Article tags

Reader Comments

   

Add your comment

All fields must be completed. Your email address will not be displayed or used to send marketing messages.

All messages will be checked by moderators before appearing on the site.

See our Privacy Policy for more information.

Related articles

Editing-an-excel-function

Simple programming with Excel

How a quick DIY function can save significant amounts of time

Robots teach children programming

Software programs dance steps

Programming language

Question & Answer

Q.Is my phone’s Bluetooth any use?

> Read the answer

Q.Can I switch boot drives so that I can work on older...

> Read the answer

Q.Can I open my old genealogy files or have they gone...

> Read the answer

Best deals on the web

img

Samsung RV520-A07

£356.50- Buy it now

img

Acer Aspire 5750G (LX.RXP02.019)

£399.99- Buy it now

img

Apple MacBook Pro (MD313B/A)

£904.37- Buy it now

Latest issue & subscription deals

Poll

Are you concerned about viruses that target mobile phones?

Jargon Buster

Computing terms explained in plain English

VoIP

Voice over IP. The routing of voice conversations over the internet, which is cheaper than the telephone...

Great shopping deals from Computeractive