Blog Advertising - Advertise on blogs with SponsoredReviews.com

How to Program Using QBasic

| February 6, 2013

An easy guide to start basic Qbasic programming.251px-I-wrote-this-program-during-a-particularly-dull-English-Lit-class

 

 

 

 

[dividers style="3"]

[notice type="support" title="STEP BY STEP" tag="h4"]STEP[/notice]

STEP 1

Get QBasic. Simply Google “QBasic download”. you find it within seconds and it is completely free. (Or you can follow this link.)[1]

STEP 2

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.

STEP 3

Here`s a very simple list of terms you will need:

  1. line — a line of you code like a sentence
  2. block — a block of line like a paragraph
  3. circle — a circle with dimension you desire

ex:CIRCLE (12,34)-(23,90)

STEP 4

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).

STEP 5

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?

STEP 6

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$; “.”

STEP 7

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.

[dividers style="3"]

[notice type="information" title="TIPS" tag="h4"]Read the help file.[/notice]

 

 

 

Tags: , , , , , , , , ,

Category: How-To, Programming Tutor

Comments are closed.

Advertiser Here !!!, iPad, Android phones, BlackBerry, iPod, iPhone, Macs and hundreds more!
Blog Advertising - Advertise on blogs with SponsoredReviews.com