Debugging via code
From ROBOTC API Guide
(Created page with "In ROBOTC, users may find the need to open certain debugger windows every time the program runs. Luckily, ROBOTC has a coding option that allows users to set certain debug win...") |
|||
| (4 intermediate revisions by one user not shown) | |||
| Line 1: | Line 1: | ||
| + | <yambe:breadcrumb self="Debug Via Code">General|General Programming</yambe:breadcrumb> | ||
| + | <br /> | ||
| + | |||
In ROBOTC, users may find the need to open certain debugger windows every time the program runs. Luckily, ROBOTC has a coding option that allows users to set certain debug windows to do just that: the DebuggerWindows() pragma statement. | In ROBOTC, users may find the need to open certain debugger windows every time the program runs. Luckily, ROBOTC has a coding option that allows users to set certain debug windows to do just that: the DebuggerWindows() pragma statement. | ||
| − | To use this feature, each window that needs opened must have its own '#pragma debuggerwindow("DebugName") ' statement prior to any other code in the program (it is recommended to place them directly under the Motor and Sensors Setup pragma statements). For instance, #pragma DebuggerWindows ("Globals") is required to open the Global Variables window each time a program runs. | + | To use this feature, each window that needs opened must have its own '#pragma debuggerwindow("DebugName") ' statement prior to any other code in the program (it is recommended to place them directly under the Motor and Sensors Setup pragma statements). For instance, #pragma DebuggerWindows ("Globals") is required to open the Global Variables window each time a program runs. <br /><br /> |
| + | |||
| + | [[File:Debugger_Windows_Example.png]] <br /><br /> | ||
| + | |||
| + | {| | ||
| + | !min-width="50 px"|'''Debugger Window''' || '''Pragma Statement''' | ||
| + | |- | ||
| + | |Global Variables || <syntaxhighlight lang="ROBOTC">#pragma DebuggerWindows("Globals")</syntaxhighlight> | ||
| + | |- | ||
| + | |Local Variables || <syntaxhighlight lang="ROBOTC">#pragma DebuggerWindows("Locals")</syntaxhighlight> | ||
| + | |- | ||
| + | |Debug Stream || <syntaxhighlight lang="ROBOTC">#pragma DebuggerWindows("debugStream")</syntaxhighlight> | ||
| + | |- | ||
| + | |Joystick Control - Basic|| <syntaxhighlight lang="ROBOTC">#pragma DebuggerWindows("joystickSimple")</syntaxhighlight> | ||
| + | |- | ||
| − | + | |} | |
Latest revision as of 12:32, 20 November 2012
General Programming → Debug Via Code
In ROBOTC, users may find the need to open certain debugger windows every time the program runs. Luckily, ROBOTC has a coding option that allows users to set certain debug windows to do just that: the DebuggerWindows() pragma statement.
To use this feature, each window that needs opened must have its own '#pragma debuggerwindow("DebugName") ' statement prior to any other code in the program (it is recommended to place them directly under the Motor and Sensors Setup pragma statements). For instance, #pragma DebuggerWindows ("Globals") is required to open the Global Variables window each time a program runs.
| Debugger Window | Pragma Statement |
|---|---|
| Global Variables | #pragma DebuggerWindows("Globals") |
| Local Variables | #pragma DebuggerWindows("Locals") |
| Debug Stream | #pragma DebuggerWindows("debugStream") |
| Joystick Control - Basic | #pragma DebuggerWindows("joystickSimple") |
