A BEGINNERS GUIDE TO UNDERSTANDING
|
QBASIC is short for Quickbasic. It is a computer programming language invented by Microsoft. It is an interpreted language. That means it is scanned line by line each time it is run. To load QBASIC, click on the Start menu (Windows 95/98/2000/ME/XP) and then click on Run. Next type Qbasic in the Open/Run window. Within seconds a blue screen should appear. If this doesn't happen, you can always locate it under usually C:\DOS\QBASIC.EXE. Just type that line into the Run window. Using QBASIC you can write easy structured code that looks both professional and extremely logical. Let's suppose you want QBASIC to print a line that greets you (the typist or user) and then asks for your name. Try entering this code in QBASIC: |
Here's how it works. On the first line DIM Name$(20) we have dimensioned a string called Name$. You can visualize a string like a bunch of letters being tied together by a plus sign. Like this: N + a + m + e. When you delete the plus signs and combine the letters, you get the word Name Does this clarify how a string works for you now? Also notice that the string Name$ is set to a specified length of 20. The gives QBASIC a place to hold up to 20 characters. The reason for this is that some people have longer names. Lets suppose that the string Name$ contains a name called Alexander What would be the total length? If you guessed 9, then you are correct. Just count the letters in the name Alexander. |