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

Get help with using AutoHotkey 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: 5663
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”

Who is online

Users browsing this forum: Bing [Bot], Gorgrak, markhavemann, neo256, Tomo2407 and 43 guests