Compare the two numbers of free bytes available. The second number is two or three less than the first. Because simplicity is more important to a beginning programmer than conservation of computer memory, the program lines in this section will usually contain only one statement per line. One exception will be a PRINT statement that inserts a blank line between segments of the program. Type in the new line below to see the effect: 1.1.9 PRINT: PRINT "CONGR~TUL~TIONS! " RUN DIM AND INPUT: DIMENSIONING AND INPUTTING STRING VARIABLES The computer must be programmed to respond to a question. You can use a PRINT command to ask a question and an INPUT command to enter a response into the computer.
However, when you give the computer an answer, the computer must know where to put it. It places it in a spot called a "variable" in RAM memory. If the answer is composed of letters, numbers, or both , it is called a "string variable ." Your ATARI 130XE Computer needs to know how much space you will need for an answer so that it can reserve space for it. This -process is called "dimensioning the string variable." The DIM (dimensioning) command always accompanies the INPUT command for string variables because DIM determines the expected size of the answers. For variables, the size refers to the number of characters, including blanks, that are needed.
You have to tell the computer the ma ximum number of spaces that the answer can occupy. Change the loop program to a program that asks a question and expects an answer. There is no need to rewrite the program; just write in the new lines-lines 10, 120, 130, and 140-as shown below. (Typing in the new line 120 automatically erases the old line 120.) 1.9 DIM ~NSWER$ (1.99] 1.1.5 PRINT "VOU JUST WON THE LOTTERV. " 1.29 PRINT: PRINT "HOW DOES TH~T M~KE YOU FEEL?" 1.39 INPUT ~NSWER$ 1.49 PRINT" I THOUGHT YOU WOULD S~V TH~T • " 1.1.9 PRINT: PRINT "CONGR~TUL~TIONS! " RUN 43