The name QBasic is an acronym for Quick Beginners All Purpose Symbolic Instruction Code. It was developed and launched by Microsoft in the year 1991 and is considered to be one of the most ideal languages for absolute beginners. It was intended as a replacement for GW-BASIC. QBasic was based on earlier QuickBASIC 4.5 compiler. It does not produce .exe files but instead generates files with extension .bas which can only be executed immediately by the built in QBasic interpreter. It is based on DOS operating systems but is also executable on windows.
Beginning with QBasic:
QBasic is available as an open source software.
QBasic consists of two windows:
- Program Window: The window titled as ‘Untitled’ is the program window. It is the place where program/code is written
- Immediate Window: The window below Program Window titled as ‘Immediate’ is the immediate window. This window is used as a debugging tool and is used when the user wants to check the output of a single statement.
Some Basic useful commands on QBasic:
1. PRINT: This command prints the statement or data written after it. If the data to be printed is a string then it is written inside double quotes (” “) and if it is a number or a variable it can be written directly.
PRINT "HELLO GEEKS"
2. INPUT: INPUT command is used to take inputs/data from the user. It can be used to input both strings and numbers.
If the data to be taken is a numerical value then the variable name in which it is to be stored is written directly after the INPUT command.
INPUT "[message to user]"; [variable_name]
If the data to be taken is string then the variable name in which it is to be stored is written followed by $ after the INPUT command.
3. CLS: CLS stands for Clear Screen and is used to clear the screen if some previous results/outputs are present on the screen.
Below is a simple program to illustrate above commands:
When using INPUT commands, users are presented with the message associated with it and are asked to input values to variables.
PRINT statement prints the statements associated with it.
Applications of Qbasic:
- QBasic is the most suitable language for the beginners to start with. It introduces people to programming without any need to worry about the internal working of the computer.
- QBasic is very easy and simple to apply and create business applications, for creating games and even simple databases. It offers commands like SET, CIRCLE, LINE, etc which allow the programmer to draw using Qbasic. Hence, graphics can also be created using QBasic.
- QBasic also supports creating sounds of some desired frequency through the speakers of your PC. Though only one sound can be played at once.
Advantages of QBasic:
- The key feature of the language is its close resemblance to English.
- Syntax of your code is checked automatically.
- Qbasic has a dynamic program debugging feature.
- Lengthy programs can be broken into smaller modules
Disadvantages of QBasic:
- The language is not structured.
- Qbasic is DOS based and has now become obsolete and is limited only in the field of education and programming.
- Design Patterns : A Must Skill to have for Software Developers in 2019
- Advantages of cracking GATE from Indian Perspective
- How Did Facebook Remove 2.2 Billion Fake Accounts in the First Quarter of 2019?
- 5 Must Have Tools For Web Application Penetration Testing
- 7 Tips and Tricks to Learn Programming Faster
- 5 Women Programmers Who Changed The World!
- Why Serverless Apps?
- IoT- Recreating Healthcare
- Last Minute Notes Computer Organization
- Display Processor in Computer Graphics
- 10 Reasons Why SEO is Important for a Website
- Internet of Things Based on Compressive Sensing
- What is the difference between Front-End and Back-End Web Development?
- Automation Tools for Testing Android Applications
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.