Ref:
https://autohotkey.com/docs/commands/IfIn.htm
Code: Select all
ABC := ["foo", "bar", "baz"]
A := "foo"
if A in %ABC%
{
Tooltip % "foo - "
}
; OR
if A in ABC
{
Tooltip % "foo - "
}
; BUT
if A in foo,bar,baz
{
Tooltip % "foo - "
}
Code: Select all
ABC := ["foo", "bar", "baz"]
A := "foo"
if A in %ABC%
{
Tooltip % "foo - "
}
; OR
if A in ABC
{
Tooltip % "foo - "
}
; BUT
if A in foo,bar,baz
{
Tooltip % "foo - "
}
Code: Select all
if Var in MatchList
if Var not in MatchList
if Var contains MatchList
if Var not contains MatchList
and also:A comma-separated list of strings
The operators "between", "is", "in", and "contains" are not supported in expressions.
Code: Select all
x := "bar"
var := "foo," . x . ",baz"
if x in %var%
{
Tooltip % "foo - "
}
Code: Select all
A := {"foo": 1,"bar": 2, "baz": 3}
if (A.HasKey("bar"))
{
Tooltip % "foo - "
}
Code: Select all
Loop % (A:=["foo", "bar", "baz"]).MaxIndex()
{
if (A[a_index] == "bar")
{
MsgBox, test
}
}
Users browsing this forum: Bing [Bot], Chunjee, Joe Glines, JoeWinograd, LeFunk, mikeyww, Miki86, RaZorwiresc2 and 59 guests