Line 10 tells the computer to save enough space in its memory for an
answer that is a maximum of 100 characters. The variable in this
program has been named ANSWER. The variable is going to store
letters and numbers, so it is a string variable. String variables are
designated by a dollar sign after the last letter of the variable name.
Line 130 allows you to enter an answer. When you run the program,
the computer displays the question on the screen, and you then type
in your answer. That answer is stored in the string variable called
ANSWER$. If the DIM statement, line 10, was omitted, an Error
message would occur, and the INPUT statement wouldn't work.
?: Courtesy of INPUT
Run the program again. Two question marks will appear on the
screen. The second question mark will be on the line next to the left
margin. List your program and notice that you typed only one question
mark in the program. The INPUT command always puts a question
mark on the screen for you. Type the variation of line 120 below:
120 PRINT HOW DOES THAT M A K E YOU FEEL" ;
Run the program and type in your response when the computer asks
its question. Now only one question mark appears, and your answer
immediately follows the question on the same line. Create some more
dialogue by dimensioning more string variables and inserting more IN-
PUT statements. The DIM statements should be at the beginning of
the program:
20 DIM DATE$ (25)
140 PRINT:PRINT "WHEN WOULD YOU LIKE TO COME AND PICK UP
YOUR PRIZE";
150 INPUT DATE$
RUN
String Variables in PRINT Statements
The computer program now asks two questions but doesn't respond to
your last answer. To get a response, you can place the string variable
in the PRINT statement in the following way:
160 PRINT "I'M S O R R Y BUT, OUR OFFICES A R E ALWAYS CLOSED
ON ";DATE$;" . TOO BAD! "
The semicolon glues the string variable between two phrases in
quotation marks. Run the program. If the words are not spaced
correctly, compare your line to the line above. You probably left out a
44
Содержание 65XE
Страница 1: ...ATARI 65XE PERSONAL COMPUTER OWNER S MANUAL TM...
Страница 3: ...ATARI 65XE PERSONAL COMPUTER TM...
Страница 6: ...Part 1 GettingStarted 1...
Страница 9: ...4...
Страница 23: ...18...
Страница 25: ...20...
Страница 32: ...Part 2 Programming withATARI BASIC 27...
Страница 33: ...28...
Страница 59: ...54...
Страница 69: ...64...
Страница 82: ...Part3 Appendices 77...
Страница 83: ...78...
Страница 97: ...92...
Страница 105: ...100...
Страница 125: ...120...
Страница 126: ...121 Index...
Страница 127: ...122...
Страница 134: ...ATARI 1987 Atari Corp All Rights Reserved Printed in Taiwan C072018 001 REV B K l 2 1987...
Страница 135: ......