IsSet() does not work for individual array keys?! Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
RomAnT
Posts: 21
Joined: 23 Sep 2021, 13:19

IsSet() does not work for individual array keys?!

Post by RomAnT » 24 Sep 2021, 08:14

Running this code

Code: Select all

myarr := []
myarr.push 555

if (isSet(myarr[1]))
	msgbox myarr[1]
Getting this error.

Code: Select all

Error:  IsSet requires a variable.
--->	061: If (isSet(myarr[1]))
The program will exit.
Please tell me this is BUG not intended to be this way.

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

Re: IsSet() does not work for individual array keys?!  Topic is solved

Post by swagfag » 24 Sep 2021, 08:23

u use Array::Has(), not IsSet()

RomAnT
Posts: 21
Joined: 23 Sep 2021, 13:19

Re: IsSet() does not work for individual array keys?!

Post by RomAnT » 24 Sep 2021, 10:56

Works thanks.

Code: Select all

myarr.has(1)

Help reference

Post Reply

Return to “Ask for Help (v2)”