Using a listvars hotkey to view local variables

Get help with using AutoHotkey and its commands and hotkeys
Peabianjay
Posts: 47
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: 491
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: 47
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”

Who is online

Users browsing this forum: Albireo, DanRim, DMDComposer, Gushou, hishighness, kjmcneil, Lecso0522, mikeyww, mmmax and 60 guests