;关联数组的值是否存在的判定
;da := { "c":0, "b":0, "a":0 }
;if % da.HasKey("a")
;msgbox,有
;Else
;MsgBox,没有
;简单数组的值是否存在的判定
da := ["c","b","a"]
if % HasValue(da,"a")
msgbox,有
Else
MsgBox,没有
Return
hasValue(haystack, needle) {
if(!isObject(haystack))
return false
if(haystack.Length()==0)
return false
for k,v in haystack
if(v==needle)
return true
return false
}
暂无讨论,说说你的看法吧