Rockwell Automation 1747-PBASE BASIC Development Software Programming Manual User Manual

Page 112

Advertising
background image

Publication 1746-PM001A-US-P

9-12 Communicating with the Module

Figure 9.3 Watch Window

6. Press [

F1

] to bring up help on the BASIC Debugger, [

Esc

] to return to the

debugger screen.

7. Move the cursor until it marks the variable

y

in the fourth line of the program.

8. Press [

F2

] to examine the value of that variable. Note that it is the even number

you entered in step 3. Also note that you have the option here to force a value
for this variable by typing it in and then pressing

[Enter]

.

9. Press [

Esc

] to return to the debugger screen without changing the variable’s

value.

10. Move the cursor down to mark the variable

x

in the fifth, sixth or seventh line

of the program. Note that you can select a variable wherever it occurs in a
program.

11. Press [

F2

] to examine the value of that variable. Note that it is half the value

you entered in step 3, which is consistent with the way this program sorts even
numbers.

12. Press [

Esc

] to return to the debugger screen without changing the variable’s

value.

13. While the cursor is still marking the variable

x

, press [

F3

]. Note that

x

and its

value now appear in the watch window. You can do the same thing for

y

.

+====================SOURCE FILE: C:\ABBASIC\BAS\DEBUG.BDL====================+

| 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 |

| >> EOF << |

| |

| |

| |

|==========================WATCH WINDOW=================================== ===|

| |

| |

| |

1Help 2Inquir 3Watch 4Gotill 5Screen 6Search 7Trace 8Layout 9Run 0Quit

Advertising