И для полноты картины, стоит упомянуть, что массивы - это объекты:
list := "Arthas|Stone|Tree", var := "Stone"
proto := []
proto.HasValue := Func("__HasValue")
proto.Split := Func("__Split")
proto.lastScan := {}
arr := New proto
;arr.Push("Arthas", "Stone", "Tree")
arr.Split(list)
arr.HasValue("Stone")
MsgBox % Format("Ключей с искомым значением найдено - {}`nПервый по порядку ключ - {}", arr.lastScan.count, arr.lastScan.keys[1])
__HasValue(this, value) {
this.lastScan := {"count": 0, "keys": []}
For key, item in this {
if (item == value) {
this.lastScan.count++
this.lastScan.keys.Push(key)
}
}
}
__Split(this, string) {
this.Push( StrSplit(string, "|")* )
}