Well, It seems to me that a alot of the newbs that sign up for AO don't know any programming languages. So i decided i'd attempt to teach them Qbasic. Here goes nothing.


PART ONE : HISTORY OF BASIC, GETTING QBASIC AND BEGGINGING COMMANDS

Well, lets start with the BASIC's {rimshot}. BASIC (standing for Beginner's All Purpose Symbolic Instruction Code) is a system developed at Dartmouth College in 1964. It was meant to be a very simple language to learn and also one that would be easy to translate. Furthermore, the designers wished it to be a stepping-stone for students to learn on of the more powerful languages such as FORTRAN or ALGOL.

Just as a note, you have to have windows to use Qbasic, so *nix and Mac owner, you can still learn basic, just not here. The first thing to do is to get the Qbasic interpreter. Now I was going to write up the complicted procedure of getting it through the Windows OS CD, but I think I’ll just upload the files. Check at da bottom Download those files to C:/Windows/command and them open up an MS-DOS prompt or command prompt if you have XP. Type ‘qbasic’ and a blue screen should come up with a box in front of it that says “Welcome to MS-DOS Qbasic”. Hit escape, and you should be brought through to a blue screen. This is where you Type your program in.

Ok, the first thing that you do before I start about the commands there’s two that you NEED to know. The first is ‘cls’ . This command clears the screen, and is (almost) always put in the first line of the program. The second need to know command is ‘end’
This command (go figure) ends the program, and always goes at the end. Even if you have more instructions after ‘end’, the computer stops reading there.

The first command to get you started is ‘print’. Print prints whatever else is on the line that is inside the quotation marks. An example in use would be:

CLS
PRINT “This sentence prints.”
END

When you run the program, it prints (without the quotation marks) “This sentence prints.” Simple, eh? Just as a note, there is also another command that does the same thing, only with a few changes. This command is ‘write’. It is used just like print, except that instead of printing without the quotation marks, write prints with the quotation marks. Okay, now that you have your first program, you have to run it. Hit SHIFT + F5 or go to Run -> Start. Well, that’s it for print and write.

Next, you need to know how to input data in to the program. First, print your question. Then on the next line type ‘INPUT whateveryouwantyourvariablecalled$’. If your variable is just a number, you can get rid of the ‘$’ sign at the end. Heres an example of the use:

CLS
PRINT “Hello, how are you today?”
INPUT howareyou$
END

Now, what good is putting data in to your program if you can’t get an output from it? To put your variable in to the printed string you would do

PRINT “Well, I’m feeling “ + howareyou$ + “ too!”

So the program will be as follows:

CLS
PRINT “Hello, how are you today?”
INPUT howareyou$
PRINT “Well, I’m feeling “ + howareyou$ + “ too!”
END

Well, that’s all for this time. I have to go do other stuff, but keep checking for parts two through whenever I don’t feel like doing these anymore.