
Re: See all variables without being global?
In ROBOTC 3.50 and above, there is a new debugger window called "Local Variables". There are two windows now for variables:
1. Global Variables - Displays all variables declared outside of any procedure or task.
2. Local Variables - Displays all variable in the currently selected function when the debugger has the program suspended.
The reason why the Local Variables is not able to display the variables during execution is that for each function calls the variables are released from the stack and ROBOTC can't keep track of which variables are associated to the stack memory addresses between function calls. This is similar to most modern IDE's (such as Visual Studio) that cannot display variables unless the program is currently suspended via a breakpoint or Step command which only show the variables in the current procedure or function. Global variables do not have this issue as they are assigned a fixed memory address at compile time.
If you need a "live update" of local values, I would recommend looking at using the "WriteDebugStream" commands and watching the Debug Stream debugger window which will give you a "printf" style printing capability to a terminal like window. To learn more, take a look at
http://www.robotc.net/wiki/Debug_Stream
_________________Timothy Friez
ROBOTC Developer - SW Engineer
tfriez@robotc.net