37
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
Scopes in Watch
The watch facility is only active when the Virtual Machine is not running, i.e. the
execution is stopped. Naturally, the TIDE cannot fetch variable values while the
Virtual Machine is executing your program.
You already know that when the Virtual Machine it stopped, the
may be either "BREAK" or "PAUSE". Properties and global variables may
be inspected in the either state. Local variables only exist in their context. Hence,
a particular local variable can only be inspected when the state is "BREAK" (the
Virtual Machine is in the middle of a code execution -- there is an execution pointer
visible) and when this variable exists in the current context.
For example:
sub
sub_one
dim
x
as
byte
x =
1
end
sub
sub
sub_two
dim
x
as
byte
x =
2
end
sub
sub
sub_two
dim
i
as
integer
i =
5
end
sub
Let us say you add x to the watch list.
When the execution pointer highlights the end sub keyword for sub_one, the
value of x in the watch would be 1. When the pointer highlights the end sub for
sub_two, the value of x in the watch would be 2. Note that these are two different
local variables!
Similarly, when the execution pointer is at the end sub of sub_three, the x
variable in the watch will be undefined -- it will display a question mark.
These same rules apply to the watch tooltip, as well. Even if you hover the mouse
over the x of sub_one when the program pointer is at the end of sub_two, the
value displayed would be the one set in sub_two -- because this is the current
context!
4.1.8.7
Code Profiling
Code Profiling is the practice of measuring how long it takes for different portions
of your program to execute.
This is the timer, located on the Status Bar.
Each time execution begins or resumes in debug mode, the timer is reset and
starts counting. Once execution is stopped for whatever reason, the timer displays
the time elapsed since execution has begun or resumed.
Remember, as covered
, every additional breakpoint
somewhat slows down the speed of execution of your project.
28
30