Using Step Into buttonīy continuously pressing the Step Into button you can execute each command of your program and observe the outputs of the writeDebugStream and writeDebugStreamLine commands in the Controller Debug Stream.
If you need better control over the program and want to observe how each command is executed then use the Step Into, Step Over and Step Out buttons of the Program Debug window. The execution stops automatically after the whole program has been executed.
ROBOTC FUNCTIONS CODE
On pressing the Start button of the Program Debug window, the program execution starts and the following output of the example code is observed in the Controller Debug Stream. This will open up a blank Controller Debug Stream window. Now Go to “Robot –> Debugger Windows…” and click on “Debug Stream”. Running the Debug Stream Example ProgramĪfter downloading the program, the Program Debug window will pop up with options: Start, Suspend, Step Into, Step Over, Step Out, Clear All and Refresh. It is therefore a good practice to not let your messages exceed 19 characters in length, and if they do, use multiple writeDebugStream functions to print them. If a message or String variable exceeds 19 characters in length then a warning is displayed on compilation of the program- “String “…” exceeds 19 chars” and on running the program only the first 19 characters will be displayed.
Note:- A message must be at most 19 characters long in ROBOTC.
ROBOTC FUNCTIONS HOW TO
An example code showing how to write variables and messages to Debug Stream is shown here. The writeDebugStream function writes a string, passed as an argument to the function, to the debug stream while the writeDebugStreamLine function writes the string to the debug stream and then goes to a new line. Now use the predefined ROBOTC functions- writeDebugStream() and writeDebugStreamLine() in your program to print out a message or the current value of a variable, in the debug stream window. These functionalities will be grayed-out initially, and are available once you run a program. You will now be able to see the Debug Stream functionality under Debugger Windows.
ROBOTC FUNCTIONS WINDOWS
You will now find that the number of options under the Robot menu and the functionalities available in Debugger Windows have increased. To change the Basic user level in your ROBOTC– Click on the Window menu and under the Menu Level option, select the Super User functionality. This page shows how to use the Debug Stream in ROBOTC. The Debug Stream is the most useful option out of the three and is not available to the Basic user, but is available to the Expert and Super users.