Sharp OZ-707 Operation Manual - Page 31

Beginning to Program

Page 31 highlights

Beginning to Program After all your practice in using the Card as a calculator, you are probably quite at home with the keyboard. From now on, when we show an entry, we will not show every keystroke. Remember to use the I 2nd FIlor ISHIFT I key to access characters above the keys and to end every line by pressing the IENTER I key. Now you are ready to program! To enter program statements into the Card, the Card must first be placed in the PRO (program) mode using thell BASIC II key. "PRO MODE" will be displayed followed by the prompt. Enter the NEW command. I PNREWO MODE ) I Ii The NEW command clears the memory of all existing programs and data. The prompt appears after you press the I ENTER I key, indicating that the Card is awaiting input. Example 1 - Entering and Running a Program Make sure the computer is in the PRO mode and enter the following program: 10PRINT"HELLO" PRO t10DE NEW 10PRItH"HELLO"- Notice that the Card automatically inserts the colon between the number and the command when you press the IENTER I key. Check that the statement is in the correct format and then change the mode to RUN by pressing thell BASIC Ilkey. ICeCE I RUN IENTER I RUt-l HELLO > 50 .----- Since this is the only line of the program, the Card will exit the program and return to the BASIC prompt" > ft. Example 2 - Editing a Program Suppose you wanted to change the message that your program was displaying. That is, you wanted to edit your program. With a single line program you could just retype the entry, but as you develop more complex programs, editing becomes a very Important component of your programming. Let's edit the program you have just written. Are you still in the RUN mode? If so, switch back to the PRO mode. You need to recall your program in order to edit it. Use the up arrow GSJ key to recall your program. If your program was completely executed, the [2SJ key will recall the last line of the program. If there 0 0 was an error in the program, or if you used the key to stop execution, the [2SJ key will recall the line in which the error or break occurred. To make changes in your program, use the [2SJ key to move up in your program (recall the previous line) and the [YJ key to move down in your program (display the next line). If held down, the [2SJ or [YJ key will scroll vertically (up or down) through your program. Remember that to move the cursor within the program line you use the ~ (right arrow) and ~ (left arrow) keys. W USing the key, position the cursor over the first character you wish to change: [2SJ 10:PRINT "HELLO" 10 PRINT "~ELLO" Notice that the cursor is now in the flashing block form, indicating that it is on top of an existing character. Enter: GOODBYE'" 10 EPRn I!N_T "GOODBY 51

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128

.-----
Beginning to Program
After
all
your practice
in
using the Card
as
a calculator, you are
probably quite at home with the keyboard. From now on, when
we
show
an
entry, we will not show every keystroke. Remember
to
use
the
II
2nd
F
Ilor
I
SHIFT
I key to access characters above the keys and to
end every line by pressing the
I
ENTER
I key.
Now
you
are ready
to
program!
To enter program statements into the Card, the Card must first
be
placed
in
the PRO (program) mode using thell
BASIC
II
key.
"PRO MODE" will be displayed followed by the prompt.
Enter the NEW command.
I
PRO
MODE
I
NEW
)
The NEW command clears the memory of all existing programs
and
data. The prompt appears after you press the I
ENTER
I key, indicating
that the Card
is
awaiting input.
Example 1 -
Entering and Running a Program
Make sure the computer
is
in
the PRO mode and enter the following
program:
10PRINT"HELLO"
PRO
t10DE
NEW
10PRItH"HELLO"-
Notice that the Card automatically inserts the colon between the
number and the command when you press the
I
ENTER
I key.
Check that the statement
is
in
the correct format and then change the
mode
to
RUN
by pressing thell
BASIC
Ilkey.
I
CeCE
I
RUN
I
ENTER
I
---
50
RUt-l
HELLO
>
Ii
Since this is the only line of the program, the Card will exit the
program and return to the BASIC
prompt"
>
ft.
Example 2 -
Editing a Program
Suppose you wanted to change the message that your program was
displaying. That is, you wanted
to
edit your program. With a single line
program you could just retype the entry, but as you develop more
complex programs, editing becomes a very Important component of
your programming. Let's edit the program you have just written.
Are you still
in
the
RUN
mode?
If
so, switch back to the PRO mode.
You need to recall your program
in
order to edit
it.
Use the up arrow
key
GSJ
to recall your program. If your program was completely
executed, the
[2SJ
key will recall the last line of the program. If there
was an error
in
the program, or if you used the
00
key to stop
execution, the
[2SJ
key will recall the line in which the error or break
occurred. To make changes
in
your program, use the
[2SJ
key to
move up
in
your program (recall the previous line)
and
the
[YJ
key to
move down
in
your program (display the next line). If held down, the
[2SJ
or
[YJ
key will scroll vertically (up or down) through your
program.
Remember that
to
move the cursor within the program line you use the
~
(right arrow) and
~
(left arrow) keys.
USing
the
W
key, position the cursor over the first character you
wish to change:
[2SJ
10:PRINT
"HELLO"
10
PRINT
"~ELLO"
Notice that the cursor
is
now
in
the flashing block form, indicating that
it
is
on top of
an
existing character. Enter:
GOODBYE'"
51
10
PRINT
"GOODBY
En
!_