Page 1 of 1

Easy Method to Add/Remove Variables to WatchList

Posted: Thu May 04, 2006 5:08 am
by oldefoxx
WatchList is potentially better for watching structure contents than Variable Viewer is, but two things make it somewhat harder to use.

First, You cannot access or edit the WatchList unless you Compile/Run the program. That might be necessary, but it is inconvenient if you want to add or remove a variable in the WatchList before the program runs. You pretty much have to set a breakpoint or insert a CallDebugger command to stop the program, edit the WatchList, then Continue execution or step the program,

Second, You don't have a real convenenient way to use an F-key or mouse
button to toggle a variable under the cursor or mouse position to have it
added or removed quickly from the WatchList - at least I haven't found one yet. You end up having to open the WatchList, then make changes there. either copying and pasting the selected variable, or to just remove or delete it from the list.

Hmmm. I've recpmsidered a part of this requiest. I just want the
ability to add a variable from the source file to the WatchList by using an
F-key or mouse. To remove it, just open the WatchList and remove it
there. Then no confusion about whether the variable is in the WatchList
or not, and eliminatges the uncertainty that a toggle action would cause.

Posted: Thu May 04, 2006 8:37 am
by Fred
In the variable viewer, you can right click on a variable and select 'Add to watchlist'. May be it helps ?

Posted: Fri May 05, 2006 12:38 am
by oldefoxx
Well, Fred. That's good to know. Of course I have to open the Variable Viewer and scroll it to find the right variable, and if it is an element of a
structure, I can't really pick up on it that way. Structures do not get shown.
but I did note that manually adding a structured variable does look look like
it displays okay. However, in the source code I could be looking right at the statement where a particular element is being assigned or used, and if I could click on it there, with the right choices present, I could either see its current value, or assign it to the WatchList to be monitored in further use.

So it is not quite the same thing, is it? By the way, I really appreciate your efforts to keep up with postings on these forums. Nice to know I am being listened to by the top dog himself.

Posted: Fri May 05, 2006 12:52 am
by Phoenix
In Visual Basic you can pause the program with the debugger and if you put the mouse over a variable you can see its value. I guess this is too much of a dream to implement in PureBasic???

Posted: Fri May 05, 2006 7:17 am
by freak
oldefoxx wrote:Well, Fred. That's good to know. Of course I have to open the Variable Viewer and scroll it to find the right variable, and if it is an element of a
structure, I can't really pick up on it that way. Structures do not get shown.
Just doubleclick on the structure in the Variable Viewer, and you can see its contents.
Maybe reading the helpfile would help ?

Posted: Fri May 05, 2006 7:43 am
by oldefoxx
The point is, Fred, that I did learn that trick earlier. But First you have to bring up the Variable Viewr, so click one. Then you have to negotiate the Variable Viewer list to find the structure that you want. Several clicks or drags involved in doing this. Then you have to click on the structure name, and that opens up the elements within the scructure. Then you have to select the element you want to view, which again may be an embedded structure, such as an API COORD or SMALL_RECT. Which means more clicks. then I have to click on the final element, and select that I want to add it to the WatchList, So instead of one simple interaction, I have to go through multiple steps, and that means the slow and awkward way is to try and use Variable Viewer for this purpose. A simple cut-and-paste from the source file would be easier, and that takes us back to saying that being able to use an F-key or Mouse action would be even easier.

And of course, that would be just to watch one element of a structure. What if I wanted to watch multiple elements, from that structure or others? I might be at this task for quite awhile, each one making wonder why there just wasn't a more direct way to do the same thing, something that directly related to the source code that I am presently trying to debug.