Skip to content

Commit

Permalink
Create HasVal.ahk
Browse files Browse the repository at this point in the history
  • Loading branch information
Thierry Dalon committed Oct 20, 2023
1 parent 97e6049 commit 75641f8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Lib/HasVal.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
HasVal(haystack, needle) {
for index, value in haystack
if (value = needle)
return index
if !(IsObject(haystack))
throw Exception("Bad haystack!", -1, haystack)
return 0
}

0 comments on commit 75641f8

Please sign in to comment.