where are values in functions submitted with return stored? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
wryyymuda
Posts: 32
Joined: 21 Sep 2018, 21:43

where are values in functions submitted with return stored?

24 Jan 2020, 13:35

in this function

Code: Select all

AnyPressedKey() {
Loop 256
if GetKeyState(Format("vk{:x}", A_Index-1),"P")
return GetKeyName(Format("vk{:x}",A_Index-1))
return 0
}
where is the 0 returned too? how would I use it, what variable would i
User avatar
boiler
Posts: 16951
Joined: 21 Dec 2014, 02:44

Re: where are values in functions submitted with return stored?  Topic is solved

24 Jan 2020, 14:05

It's returned as a result of the function call, which you can assign to a variable such as:

Code: Select all

Key := AnyPressedKey()
or use directly such as:

Code: Select all

MsgBox, % "Pressed key: " AnyPressedKey()

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: inseption86, mikeyww and 405 guests