Publication 1746-PM001A-US-P
Communicating with the Module
9-11
Debugging Example
The following example program will be used to illustrate the debugging features. It
is a simple program so that you can visualize each line’s execution as it is being
debugged.
REM THIS IS A DEBUGGING EXAMPLE
{SORT EVEN NUMBERED POSITIVE ENTRIES}
{$L START}
INPUT ”ENTER A NUMBER: ”,Y
FOR X=1 TO Y
IF X*2=Y THEN GOTO DONE
NEXT X
PRINT ”NUMBER IS ODD OR LESS THAN 1, RESTARTING”
GOTO START
{$L DONE}
PRINT ”NUMBER IS EVEN”
END
After entering the program, save it under the name DEBUG.BDL, and then
translate/compile it. If there are no errors, go to Terminal mode and download the
translated file (DEBUG.BAS) to the module. Follow the steps below to observe the
features available with the BASIC Debugger:
1. After downloading, type
RUN
to execute the program. You are prompted to
enter a number. If not, you may have a bug in the program, using the debugger
may help you find it.
2. Enter an odd number (less than 100) and press
[Enter]
. A message appears
indicating it is odd. You are prompted to enter a number again.
3. Enter an even number (less than 100) and press
[Enter]
. A message appears
indicating it is even, and the program terminates.
4. Select
deBug
from the menu at the top of the screen, then select
Run
Debugger
. If you have loaded a previously translated file for which a .MAP file
exists (as is the case with this example), a message appears indicating that
.MAP file will be used.
5. Press any key to continue. A split screen appears with your program
(DEBUG.BDL) above and a watch window below. The watch window is
where the variable values you designate will be displayed.
Содержание 1747-PBASE
Страница 1: ...BASIC Development Software Catalog Numbers 1747 PBASE Programming Manual ...
Страница 8: ...Publication 1746 PM001A US P Table of Contents vi ...
Страница 34: ...Publication 1746 PM001A US P 2 14 Getting Familiar with Your Development Software ...
Страница 72: ...Publication 1746 PM001A US P 5 8 Manipulating Files ...
Страница 88: ...Publication 1746 PM001A US P 6 16 Writing Programs Using the BASIC Development Language ...
Страница 143: ......