QuickBasic is a programming language developed by Microsoft for use in the MS-DOS operating system.
It is the successor of earlier forms of BASIC (Beginners All-Purpose Symbolic Instruction Code),
a simple programming language for beginning programmers.
QB is an ideal programming language for
beginners because of its intuitive commands, simple structure and flexibility.
It is well-documented, and hundreds of tutorials and sample programs are available for download on the Internet.
A comment starts with an apostrophe ( ' ). This is the character just left of the Enter key on the computer's keyboard.
Comment lines tell humans what the program does, or what parts of the program do. When the program runs, the computer does
not look at the comments at all. The comment lines have no effect on what the program does.
PRINT: It tells Qbasic to write something to the screen.
REM: It stands for remark and is used to add comments to the code.
INPUT: With Input, you can ask the user to enter a value.
IF...THEN...ELSE IF (condition is met) THEN (do this task) ELSE (otherwise do this)
> (greater than) : If the first value is more than the second, the condition IS met otherwise it is NOT
>= (greater than OR equal to) if the first value is greater than or equal to the second, the condition IS met otherwise it is NOT
< (less than) same as above except if the first value is LESS than the second, the condition IS met otherwise it is NOT
<= (less than OR equal to) if the first value is less than the second, the condition IS met otherwise it is NOT
=(equal to) (I think this one is pretty obvious)
<>(NOT equal to) (again, its quite obvious)
OR: The OR statement tells QBASIC to do the action after "THEN" if either of the conditions are met.
AND: The AND statement tells QBASIC to do the action after "THEN" if ALL of the conditions are met.
NOT: The NOT statement tells QBASIC to do the action after "THEN" if a condition is NOT met.
LOOPS: A loop is a sequence of instruction s that is continually repeated until a certain condition is reached.
Loops can repeat in two ways:
A specific number of times. FOR...NEXT Loops
Until a certain condition is met. DO Loops
MODIFYING A STRING
LEFT$: This command will take the left part of a string.
RIGHT$: This command will take the right part of a string.
MID$: With mid$ you can take the middle of a string by specifying where you want to start from and how many letters you want.
UCASE$: It tells QBASIC to capitalize each letter in a string.
LCASE$: It tells QBASIC to make every letter in a string lower case.
+ : adds two values
- : subtracts the second value from the first
* : (That's an asterisk) multiplies two values
/ : divides the first value by the second
^ : raises the first number by the second number. 3^2 would be 3 raised to 2, or 9
SQR(num) : Takes the square root of a number
(num) MOD (num2) : Gives you the remainder when you divide num by num2