EasyManuals Logo

Atari 800 Basic Reference Manual

Atari 800
122 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 #47 background imageLoading...
Page #47 background image
Upon
execution,
the
screen
displays
THE SQUARE ROOT OF
B$
IS
100.
It
is
not
possible
to
use
the
VAL
function
with
a
string
that
does
not
start
with
a
number,
or
that
cannot
be
interpreted
by
the
computer
as
a
number.
It
can,
however,
intrepret
floating
point
numbers;
e.g.,VAL("1E9")would
return
the
number
1,000,000,000.
STRING
Strings
can
be
manipulated
in
a
variety
of
ways.
They
can
be
split,
concatenated,
MANIPULATIONS
rearranged,
and
sorted.
The
following
paragraphs
describe
the
different
manipulations.
String
Concatenation
Concatenation
means
putting
two
or
more
strings
together
to
form
one
large
string.
Each
string
to
be
included
in
a
larger
string
is
called
a
substring
.
Each
substring
must
be
dimensioned
(see
DIM).
In
Atari
BASIC, a
substring
can
con-
tain
up
to 99
characters
(including
spaces).
After
concatenation,
the
substrings
can
be
stored
in
another
string
variable,
printed,
or
used
in
later
sections
of
the
program.
Figure
7-5 is a
sample
program
demonstrating
string
concatenation.
In
this
program,
A$,
B$,
and
C$
are
concatenated
and
placed
in
A$.
10
D I
t1
A$(
1m;
) ,
8$(
100
)
..
C$(
1 (u) )
:::.'0
A$=
II
sr~:
I
~-lGS
::.:
suB:;rp
I
~-iGS
ARE
o I
~:cu:;sE
[I
II
30
E:$=
11
IN
'AT
A~:
I
BA:::IC--A
SELF-
TEACHmG
GUIDE
Ill
4~3
C$=~~---CHAPTE~:
9.
II
50
A$(
LEt-K
A$
H 1
)=B$
6£1
A$(
LHK
A$
)+
1
>=C$
70
F'k:HH
A$
Figure
7·5.
String
Concatenation
Example
String
Splitting
The
format
of
a
subscript
string
variable
is
as
follows:
svarname(aexp1[
,aexp2])
The
svarname
is
used
to
indicate
the
unsubscripted
string
variable
name
(with
$).
aexp1
indicates
the
starting
location
oft
he
substring
and
aexp2
(if
used)
in-
dicates
the
ending
location
of
the
substring.
If
no
aexp2
is
specified,
then
the
end
of
the
substring
is
the
current
end
of
the
string.
The
starting
location
cannot
be
greater
than
the
current
length
of
the
string
.
The
two
example
programs
in
Figure
7-6
illustrate
a split
string
with
no
end
location
indicated
and
a
split
string
with
an
ending
location
indicated.
10
DH1
~:$(
5)
20
S$="A8CD#"
3e
PRWT
S$(
2)
40
END
Result is
BCD.
(without
ending
location)
10
D m
:::$.::
2~::1
>
20
S$=
11
ATAPI
80(1
E:A:::IC
11
30
PR
I t·H
S$(
7
..
9 >
40
END
Result
is 800.
(with
e
nding
loc
ation
)
Figure
7·6.
Split
String
Examples
St
ri
ngs
39

Table of Contents

Other manuals for Atari 800

Questions and Answers:

Question and Answer IconNeed help?

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

Atari 800 Specifications

General IconGeneral
ProcessorMOS Technology 6502
Processor Speed1.79 MHz
ROM10 KB
GraphicsANTIC and GTIA chips
Release Year1979
Display Resolutionup to 320 x 192
Colors128 colors
Sound4 channels
StorageCartridge, cassette, floppy disk
PortsCartridge, serial, monitor
Operating SystemAtari OS

Related product manuals