Note 
The 
syntax 
of 
BASIC imposes no limit 
on 
the 
extent 
to 
which subroutines can be 
nested 
(that 
is,  on the 
number 
of 
levels 
of 
subroutine calls which can be made from 
other 
subroutines); however,  in  practice a limitation 
is 
imposed 
by 
the 
amount 
of 
free space in memory which 
is 
available for storing 
return 
addresses. 
10 
B=5 
20 
C=8 
30 
GOSUB 
100 
4-0 
PRINT  A 
50 
8=2 
60 
c = 
10 
70  GOSUB  100 
30  PRINT  A 
90 
END 
ICJO 
A=BtC 
110 
RETURN 
(GOSUBIOO) 
~ 
,-----------------7( 
I 
oo) 
I 
(A=B+c] 
{i 
(RETUR~ 
( 
PRJNTA]13displayed.: 
D 
I 
·) 
(-
--
--
-
----
-----
--
~ 
[PRINTA 
)12 
displayed. 
0 
2. 3. 6. 4 
IF~ 
THEN 
.........
.
.........
. . . .
...... 
(abbreviated format: 
... 
IF~ 
TH.) 
I  Format  I 
IF 
e THEN Ln 
Function 
IF 
e THEN 
statement 
e:  A relational expression 
or 
logical expression 
Ln:  Destination line 
number 
IF 
... 
THEN statements are used 
to 
control branching 
of 
program execution accord-
ing 
to 
the  result 
of 
a  logical 
or 
relational  expression.  When  the result 
of 
such an 
expression 
is 
true,  statements  following  THEN  are  executed. 
If 
a  line 
number 
is 
specified following THEN,  program execution 
jumps 
to 
that 
line 
of 
the program 
if 
the 
result 
of 
the 
expression is true. 
If 
the 
result 
of 
the logical 
or 
relational expression 
is 
false, execution continues with 
the program line following 
that 
containing the 
IF 
. . . THEN statement. 
[!!] I  Condition I  THEN 
11 
Statement 
or 
line number 
50------------------~----------------------------------------~----------