160 User's
Handbook
to
the
Atari 400/ 800
Computers
The previous example contains a
program
that
uses
a
POP
statement
to
exit
a subroutine.
At
line
10,
X
is
assigned
the
value
5.
At
line
20,
Y
is
assigned the value
10.
At
line
30,
the
subroutine
at line
100
is
called.
At line
100,
the
value
of
X
is
displayed. Line
110
is
an
IF
/ THEN
statement that tests the
condition
X>O. Since the value
of
X
is
greater than zero, the
condition
is
true
.
As
a result, the
POP
statement
is
executed, and the program
control
branches to line
130
.
At
line
no,
the value
of
Y
is
displayed.
Since the
POP
statement
was
executed,
the
program
is
no
longer
in the
subroutine.
If
another
RETURN
statement
is
ex
ecuted,
the
program
will
not
return to line
30
,
where
the
subroutine
was
called. The
program
will
return
to
the line
of
the previous
GOSUB statement. Since
there
is
no
other
GOSUB statement in
this program, a
RETURN
statement
would
cause
an
error.
A
POP
statement can also be used
to
make the
program
ignore
the previous FOR statement. When a
POP
statement
is
executed
within
a FOR/
NEXT
loop,
the
loop
will
not
be repeated.
However,
an
error
occurs
if
a
NEXT
statement
is
executed
for
that
loop.
POSITION (POS.)
The POSITION statement moves the cursor
to
the specified
column
and row.
CONFIGURATION
POSITION a, b
The first
argument
of
the POSITION statement
determines
the
column,
and
the
second
argument
determines the
row
. The
cursor does
not
actually move when the POSITION statement
is
executed. The cursor takes on the
new
position
when
the next
PUT
,
GET
, PRINT, I NPUT,
or
LOCATE statement
is
executed.
If a POSITION statement specifies a location that
is
outside the
range
of
the display,
no
error
occurs
until
another
statement that