Listvars shows vars that are no longer used

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
netaware
Posts: 17
Joined: 29 Apr 2015, 12:52

Listvars shows vars that are no longer used

24 Sep 2021, 11:18

I am working on a script and hence have been running it over and over.
While debugging my script, i am using LISTVARS.
I noticed that there are vars in the list that i have stopped using in the script. Those lines have been deleted from the script itself as well.

Can anyone tell me why those vars are still being listed in LISTVAR output? Can I clear all variables from memory?

Thanks
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Listvars shows vars that are no longer used

24 Sep 2021, 12:44

listvars will show any declared globals that can be detected during compile time, any that u might create in the global scope or leak out, and any locals to the currently executing function(if there is any)
the global variables are never freed(but u can erase their contents, eg by assigning an empty string or with VarSetCapacity())
local variables are freed whenever the executed function goes out of scope

but basically, show the code...

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: downstairs, filipemb, OrangeCat, roysubs and 162 guests