Using a listvars hotkey to view local variables

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Peabianjay
Posts: 52
Joined: 07 Nov 2015, 22:50

Using a listvars hotkey to view local variables

06 Dec 2015, 13:17

Listvars seems somewhat unpredictable. In this sample script, it's rare for listvars to report the local variables, despite the program being in the function "permanently". With multiple attempts & refreshes, once in a while, it'll show the local variables, but mostly not.

Is there any way to make it reliably report local variables?

Code: Select all

a := "Alpha"

dostuff()
return

dostuff( )
{
    c := "Gamma"
    loop
		sleep, 55
}

F1::
    listvars
    pause
return

+Pause::
   exitapp 
return

Pause::
    Pause, Toggle, 1
Return
User avatar
AlphaBravo
Posts: 586
Joined: 29 Sep 2013, 22:59

Re: Using a listvars hotkey to view local variables

06 Dec 2015, 16:23

you would have to use the command within the function

Code: Select all

a := "Alpha"
dostuff()
return
 
dostuff( )
{
    c := "Gamma"
	ListVars
}
Peabianjay
Posts: 52
Joined: 07 Nov 2015, 22:50

Re: Using a listvars hotkey to view local variables

07 Dec 2015, 10:35

Meh. Ya, that works, 'cept then I'd have to know where the problems are before I know where the problems are.

I suppose a hotkey to set a global flag, then if (DEBUG) { listvars } in every questionable place. Even doing that in every function is a lot, let alone everywhere.

If only I didn't make mistakes, then I wouldn't need to debug stuff. :-)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww and 157 guests