How to Use BASIC Getting Started in BASIC The best way to learn the computer language into do, and you will learn much quicker if you dare to make mistakes.Don't worry about breaking the computer by mistyping something. The computer can take care of itself If you have questions about how BASIC will respond to a particular instruction, try it and sec. Each instruction has a particular format, or syntax. If you do not follow the correct syntax, BASIC will usually display an error message. You can then reenter the instruction correctly。 At first, you need to know both to get into BASIC and ho-, N, to get out. Once you have learned some BASIC, you may begin to type. After you type alien the computer will wait for you to type a signal that you arc finished with the line. You give this signal by tapping the [Enter] key.This key is usually a large one located to the right of the alphabetic keyboard. It is similar in purpose and in placement to the carriage [Enter] key on a typewriter. As You type, You'll notice a blinking light on the screen that indicates where the next character will appear. This is the cursor. When you press [Enter],the cursor moves to the beginning of the next line.The cursor always lets you know where you are on the screen. Let's try using BASIC as a calculator. We do this by using the PRINT statement, PRINT 3 3 We typed PRINT followed by a space, the digit3,and pressed [Enter].BASIC responded by display-in the digit 3. PRINT 2+2 4 We typed PRINT followed by a space and the numeric expression 2+2.BASIC evaluated the expressions and displayed the result. Here is another example: PRINT 3,2+2 34 When we tap [Enter],we tell the BASIC Interpreter to check our command for errors and, if none are found, translate the command into machine language and execute. All that happens at great speed! Let’s try a few more examples. We can make BASIC type two values on online by placing a comma between calculations. PRINT 1,2,3,4,5 12345 PRINT I,2,3,4,5 12345 Notice what happened:BASIC divided the display line into print zones.These print zones are commonly spaced columns apart, creating five print zone son an 80-column screen.(The exact number will depend on the dialect.)The comma between the values causes BASIC to skip to the next print zone for each value. By using commas,we can print output in neat columns. The extra spaces between values on the PRINT line, as in the second example, do not affect the spacing of the output。 Numeric values are displayed with a minus signing front if the value is negative and a space in front if the value is positive.In most dialects they are also followed by a space. |