Convenient Techniques - Casio FX-730P Owner's Manual

Table of Contents

Advertisement

4-5 Convenient Techniques
Following are two techniques that are convenient to know when programming.
• Using the Program Areas
This unit is provided with ten program areas
(PO
to
P9)
into which individual
programs can be stored. One method of using these areas is to locate the main
routine in one program area and the subroutine in the other area.
A
simple
example
is
shown below.
Example:
Program area PO (Main routine)
10
X=12
20 PRINT
30 PRINT CSRX;
''@'';
40 GOSUB :t:t:
1
50 GOTO 20
60 END
Program area Pl (Subroutine)
1 0
K$=1<EY$
20 IF K$=" 4 '' THEN
X=X-1 :
IF
X<0
THEN
X=0
30 IF
K$="6''
THEN
X=X+
1
:
IF
X>23
THEN
X=23
40
RETURN
When the main routine in
PO
is executed,@(unit price mark) appears at the
center of the display. Press
the~
key to move@to the left and the[§) key to
move@to the right. These are the only keys that can move@.
In
this program, the main routine in PO displays@and the subroutine in Pl cal-
culates the moving position of@by key input. The subroutine in Pl is accessed
by
GOSUB
#1 on line 40 of the main routine.
This method of allocating routines with coherent functions in one program area
facilitates the usage of long programs.
65

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents