Track Watch Setting a track watch point. ──────────────────────────────────────────────────────────────────────────────
The idea of a tracked variable is the ability to watch a particular instance of a variable (by name) at a particular level, or activation, in the call stack.
If you were at activation 1 (the base item in the call stack) and selected the variable window, you can press <Shift><Alt><W> to mark a variable as a tracked variable. This means that as long as the activation that the variable belongs to is in the call stack then you can see this variable, no matter how many other variables of the same name are between this activation and the current activation. Even if there is a variable of the same name in current activation, you will still see the one that you marked as a watch track variable.
This is handy if you want to constantly view a variable from a particular activation.
Another example for using a watch track variable would be if you were passing variables by reference. You could view both of them together at the same time, in the same window. This way you can see both occurrences of the same variable. And so if you have forgotten to pass a value by reference and it is re-assigned, you can instantly see what has happened.
Tracked variables are obtained in exactly the same way as variables in the variable window, so you cannot track an expression.
Please Note: There is one side effect of using trace or watch track variables. Imagine the scenario:
MAIN │ ┌──────┴───────┐ │ │ FRED JOHN
If the function FRED has a variable called 'cString' and so too does the function JOHN, then you watch the variable in FRED. You then go down a level and back up a level to JOHN, will men that the 'cString' in JOHN will be picked up. This is because tracked variables are located by their position in the call stack.
Tracked variables may be either watched or traced.
You can edit a track variable in exactly the same manner as a variable in the variable window, and it will only effect that instance of the variable.
You can identify a tracked variable by the following means:
cString <vwp, Local, 1, C> : "Contents" │ ││ │ │ │ │ ││ │ │ └─ Type of Contents │ ││ │ └──── Activation (From top of stack) │ ││ └───────── Variable Type │ │└─────────────── 'wp' Watch Point, 'tp' Trace Point │ └──────────────── It's a Variable └────────────────────── Variable Name
whereas a normal watch may look like this:
TestFunc() <wp, C> : "Contents" │ │ │ │ │ └─ Type of Contents │ └───── 'wp' Watch Point, 'tp' Trace Point └────────────── Expression
The hot-key combination for this item is <Shift><Alt><W>.