Highlight all variable values in IDE

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Highlight all variable values in IDE

Post by MachineCode »

I doubt this is possible, but it's always been a dream of mine. When I'm looking at a screenfull of code, I've always wish I could press and hold a hotkey, and while held, all values of all variables that are visible would appear as tooltips. Sort of like how you can hover the mouse over a single variable to pop-up its value, but a whole screenfull at once. So much easier than building watchlists and using the variable viewer. Just press and hold a hotkey -- all values pop up -- release the hotkey, they disappear again. It's sort of a "peek" feature for your code, to see what all the variables are doing. <Drool>. :lol:
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Highlight all variable values in IDE

Post by Trond »

A problem is, that the current feature already doesn't work perfectly (hovering a global I shows the value of a local I if that's where code execution is). This would have to get changed first, else this feature would show many misleading values.
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: Highlight all variable values in IDE

Post by MachineCode »

Trond wrote:hovering a global I shows the value of a local I if that's where code execution is
Say what? How can a local variable exist with the same name as a global? A global is global, after all.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Highlight all variable values in IDE

Post by ts-soft »

MachineCode wrote:Say what? How can a local variable exist with the same name as a global? A global is global, after all.

Code: Select all

Global test.i = 10

Procedure var()
  Protected test.i = 20
  ProcedureReturn test
EndProcedure

Debug var()
Debug test
:wink:
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: Highlight all variable values in IDE

Post by MachineCode »

Damn the "Protected" keyword... I always forget it's the same thing as "Local" in other BASICs. Should have the same name, and while I'm griping, FindString() should be InStr() too. There, I said it! :twisted:

[Edit] And while STILL griping, any variable set as global should NOT allow a protected one to have the same name. IMNSHO. :twisted:
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Highlight all variable values in IDE

Post by Trond »

An alternative explanation, without globals, is that a local MyVar in procedure A will display the value of a local MyVar in procedure B, if execution is in procedure B.
Post Reply