EasyManuals Logo

Atari 65XE User Manual

Atari 65XE
135 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #48 background imageLoading...
Page #48 background image
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:
110 PRINT:PRINT "CONGRATULATIONS!"
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 65XE 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 maximum 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.)
10 DIM ANSWER$ (100)
110 PRINT: PRINT"CONGRATULATIONS!"
115 PRINT "YOU JUST WON THE LOTTERY. "
120 PRINT: PRINT "HOW DOES THAT MAKE YOU FEEL?"
130 INPUT ANSWER$
140 PRINT "I THOUGHT YOU WOULD SAY THAT. "
RUN
43

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Atari 65XE and is the answer not in the manual?

Atari 65XE Specifications

General IconGeneral
CPUMOS Technology 6502C
CPU Speed1.79 MHz (NTSC) / 1.77 MHz (PAL)
RAM64 KB
ROM16 KB
Release Year1985
GraphicsANTIC and GTIA
Display Resolution320x192
SoundPOKEY sound chip, 4 channels
Operating SystemAtari BASIC
PortsJoystick, Cartridge
StorageExternal 5.25" floppy disk drive

Related product manuals