Changes between Version 19 and Version 20 of ControlSystems/SoftwareTeam/Training/GettingStarted/IntroJava


Ignore:
Timestamp:
Nov 4, 2019, 1:47:31 PM (6 years ago)
Author:
David Albert
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/SoftwareTeam/Training/GettingStarted/IntroJava

    v19 v20  
    4848== Debugger
    4949With the !VariablesExample.java program above open in the editor click to the left of the line number (7) for the line a=3; and a red dot will appear called a breakpoint.
    50 [[Image(breakpoint.jpg, 50%)]]
     50[[Image(breakpoint.jpg, 50%, margin=10)]]
    51511. Click Debug->Start Debugging
    52522. The program will start running but will stop (break) at line 7
    53 [[Image(stopped.jpg, 50%)]]
     53[[Image(stopped.jpg, 50%, margin=10)]]
    54543. Click on the Step-over icon [[Image(stepover.jpg)]] above the editor (or press function key F10) to execute that line of code and then stop again
    55554. Observe the Variables window in the left navigation panel and note that there is now a variable named 'a' with the value 3
     
    60608. Press the Continue tool [[Image(continue.jpg)]] (or function key F5) above the editor window to allow the program to continue running to the end.  Observe the value printed in the output terminal window.
    6161
     62The VSCode debug toolbar [[Image(VSC_toolbar.png)]] offers a complete set of tools to control the execution of your program:
     63* Continue / Pause F5
     64* Step Over F10
     65* Step Into F11
     66* Step Out Shift+F11
     67* Restart Ctrl+Shift+F5
     68* Stop Shift+F5
     69
     70
    6271== Conditionals
    6372Programs need to be able to react differently to varying data.  Conditional statements let us do this.  For example, a robot must be able to monitor its sensors to prevent collisions.  Consider (and try running) the following program: