Sharp OZ-707 Operation Manual - Page 32

L£1:print, Goodby, Jociiibye, Goodb, P'?int, Goodey, Joodby

Page 32 highlights

Remember to press the I ENTER I key at the end of the line. Change to the RUN mode. RUN IENTER I l£1:PRINT "GOODBY E" ! RUN (JOCIIIBYE SYnt.az error in 10 The error message indicates the type of error, and the line number in which the error occurred. Press the ICeCE I key to clear the error condition, and return to the PRO mode. You must be in the PRO mode to make changes in a program. Using [2SJ (or [YJ ), recall the line in which the error occurred. [2SJ (or [2J ) 1£1 ~~JNT II GOODB'( " The flashing cursor is positioned over the problem area. You learned, that when entering string constants in BASIC, all characters must be contained within quotation marks. Use the DELete key to eliminate the "I". 1(1 PR I NT "GOODBY E"_ Now let's put the ! in the correct location. When editing programs, DELete and INSert are used in exactly the same way as they are in editing calculations. Using ~, position the cursor on top of the character that will be the first character following the insertion. 1£1 PE'~?INT "GOODEY Press the INSert key. A "~" will indicate where the new data will be entered: 52 Enter the !. em! 113 PER' -It-H "(JOODBY Remember to press the IENTER I key so the correction will be entered into the program. Notes: 1. If you wish to DELete an entire line from your program, just enter the line number and the original line will be eliminated. The DELETE command can be used to delete more than one line at a time. 2. In the PRO mode, if keys are pressed when the cursor is not displayed, their corresponding characters are usually displayed from the leftmost column of the display. However. if the [EJ or ~ key is pressed when the cursor is displayed, successive key entries are displayed starting from the,cursor position. Example 3 - Using Variables in Programming If you are unfamiliar with the use of numeric and string variables in BASIC. reread the appropriate sections in Chapter 2. Using variables in programming allows more sophisticated use of the Card's abilities. Remember. you assign simple numeric variables using any letter from A to Z: To assign string variables you also use a letter, followed by a dollar sign. A$ = "TOTAL" The values assigned to a variable can change during the execution of a program, taking on the values entered or computed during the program. One way to assign a variable is to use the INPUT command. In the following program. the value of A$ will change in response to the data typed in answer to the inquiry "WORD?". 53

  • 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

Remember to press the
I
ENTER
I
key at the end of the line. Change to
the RUN mode.
RUN
I
ENTER
I
l£1:PRINT
"GOODBY
E"
!
RUN
(JOCIIIBYE
SYnt.az
error
in
10
The error message indicates the type of error, and the line number
in
which the error occurred.
Press the
I
CeCE
I
key to clear the error condition, and return to the PRO
mode. You must be in the PRO mode to make changes
in
a program.
Using
[2SJ
(or
[YJ
),
recall the line
in
which the error occurred.
[2SJ
(or
[2J
)
1£1
~~JNT
II
GOODB'(
"
The flashing cursor is positioned over the problem area. You learned,
that when entering string constants in BASIC, all characters must
be
contained within quotation marks. Use the DELete key to eliminate the
"I".
1
(1
PR
I
NT
"GOODBY
E"_
Now
let's put the
!
in the correct location. When editing programs,
DELete and INSert are used
in
exactly the same way as they are
in
editing calculations. Using
~,
position the cursor
on
top of the
character that will be the first character following the insertion.
1£1
P'?INT
"GOODEY
E
~
Press the INSert key. A
"~"
will indicate where the new data will be
entered:
52
---==------
--
Enter the
!.
em!
113
PR
It-H
"(JOODBY
E'
-
Remember to press the
I
ENTER
I
key so the correction will be entered
into the program.
Notes:
1.
If you wish to DELete an entire line from your program, just enter
the line number and the original line will be eliminated. The DELETE
command can be used to delete more than one line at a time.
2.
In the PRO mode, if keys are pressed when the cursor is not
displayed, their corresponding characters are usually displayed from
the leftmost column of the display. However. if the
[EJ
or
~
key
is pressed when the cursor is displayed, successive key entries are
displayed starting from the, cursor position.
Example 3 -
Using Variables in Programming
If you are unfamiliar with the use of numeric and string variables
in
BASIC. reread the appropriate sections
in
Chapter
2.
Using variables
in
programming allows more sophisticated use
of
the
Card's abilities.
Remember. you assign simple numeric variables using any letter from
A
to Z:
To assign string variables you also use a letter, followed by a dollar
sign.
A$
=
"TOTAL"
The values assigned to a variable can change during the execution of
a program, taking on the values entered or computed during the
program. One way to assign a variable is to use the INPUT command.
In the following program. the value of A$ will change
in
response to the
data typed
in
answer to the inquiry "WORD?".
53