Sharp OZ-707 Operation Manual - Page 38

Enter, command, location, stopped.

Page 38 highlights

6. Continue the trace procedure and check if the program is executing properly by confirming program execution order and variable contents after each line is executed. If the program is not executing properly, correct the logic. 7. After debugging, enter TROFF IENTER I to exit the trace mode. Example: 10 INPUT "A=";A,"B=";B 20 C=A*2 30 D=B*3 40 PRINT "C=";C;" D=";D 50 END Run the program. RUN mode TRON IENTER I RUN IENTER I 8 IENTER I (Data entry) 9 IENTER I (Data entry) > A=_ Execute INPUT command B=_ C= 16 > D= 27 Execute PRINT command End of execution (prompt is displayed) The executed line number will be displayed at the right top for about 0.5 second. When execution is interrupted with the 00 key, recall the variables manually and check that the values are as expected. Pressing the [2] key will execute one statement at a time and entering CONT IENTER Iwill execute the statements continuously. Note: The trace mode will remain in effect unless TROFF IENTER I is entered, the ISHIFT II CeCE I keys are pressed, or the power is turned off. To debug by interrupting program execution: Perform one of the following: 00 • Press the key during program execution. 00 • Press the key in the trace mode. • Enter the STOP command at the location to be stopped. 64 The Break message will be displayed and execution will be interrupted. Then 1. Check the variable contents manually. 2. Press the [YJ key to execute subsequent statements line by line. Press the ISHIFT I [YJ keys or enter CONT IENTER I to return to previous operation. 00 • A program interrupted by the key or the STOP command can CSZJ be executed line by line by pressing the key. Trace messages will be displayed at each step. 65

  • 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

6. Continue the trace procedure and check if the program is executing
properly by confirming program execution order and variable
contents after each line
is
executed. If the program is not executing
properly, correct the logic.
7.
After debugging, enter TROFF
I
ENTER
I
to exit the trace mode.
Example:
10
INPUT "A=";A,"B=";B
20
C=A*2
30 D=B*3
40
PRINT "C=";C;"
D=";D
50
END
Run the program.
RUN mode
TRON
I
ENTER
I
RUN
I
ENTER
I
8
I
ENTER
I
(Data entry)
9
I
ENTER
I
(Data entry)
>
A=_
B=_
C= 16
>
Execute INPUT command
D=
27
Execute PRINT command
End of execution
(prompt is displayed)
The executed line number will
be
displayed at the right top for about
0.5
second.
When execution
is
interrupted with the
00
key, recall the variables
manually and check that the values are as expected. Pressing the
[2]
key will execute one statement at a time and entering CONT
I
ENTER
I
will execute the statements continuously.
Note:
The trace mode will remain
in
effect unless TROFF
I
ENTER
I
is
entered,
the
I
SHIFT
II
CeCE
I
keys are pressed, or the power is turned off.
To debug by interrupting program execution:
Perform one of the following:
• Press the
00
key during program execution.
• Press the
00
key in the trace mode.
Enter
the
STOP
command
at
the
location
to
be
stopped.
64
The Break message will be displayed and execution will be interrupted.
Then
1.
Check the variable contents manually.
2.
Press the
[YJ
key to execute subsequent statements line by line.
Press the
I
SHIFT
I
[YJ
keys or enter CONT
I
ENTER
I
to return to
previous operation.
• A program interrupted by the
00
key or the STOP command can
be executed line by line by pressing the
CSZJ
key. Trace messages
will
be
displayed at each step.
65