An easy guide to start basic Qbasic programming.
[notice type="support" title="STEP BY STEP" tag="h4"]STEP[/notice]
Get QBasic. Simply Google “QBasic download”. you find it within seconds and it is completely free. (Or you can follow this link.)
Open QBasic. you should be greeted by a welcome screen and a box should be seen (after you get past the welcoming). This where the magic happens. here you simply type directions for the computer to follow.
Here`s a very simple list of terms you will need:
- line — a line of you code like a sentence
- block — a block of line like a paragraph
- circle — a circle with dimension you desire
The command you will use the most is “PRINT”.(without the quotes)
It puts words on the screen. Here is the syntax: PRINT “your text here.” this would display: “your text here.”(without the quotes).
The second most used command is INPUT.
It asks you to enter something. Here is the syntax: INPUT “your text goes here”; text$ This would display: “your text here?”(without the quotes). And save it into a temporary variable called text$ (It’s case sensitive.) that’s great, but how do we display that information?
You can go farther with PRINT.
Let’s say you have just asked someone for their name. It is saved in a variable called name$. you want to display the text “hello, (person’s name here).” You would type: PRINT “hello ,”; name$; “.”
Press F5 and you will see a message at the bottom saying “press any key to continue” and you might see some copyright stuff depending ;on which version of QBasic you have. Now press a key. You will be back a the box where you may type. Just type some random letters and press F5. You will get an error like “syntax error”. Just press ok to go on. by the way, F5 is to run your code into an interactive program. Now delete all that any type some random letters then press enter and type some more random stuff so you should have 2 lines of code. Press F5 you will see the same error just press ok. Now you may notice the first line is hi-lighted in a lighter color. This simply means this is the line you stopped at (or in this case where forced to stop at because of an error). The F5 key doesn’t run the code from the beginning but continues it from the place left off, but seeing that it never started there is no place to continue from.
[notice type="information" title="TIPS" tag="h4"]Read the help file.[/notice]