11-15-2016, 12:47 PM
Macro Macro267
Member function Acc.CbIndexOf
Create it with menu File / New / Member Function.
a11.Select(1)
int n=a11.CbIndexOf("Business"); if(n<0) end "combo box item not found"
key V ;;Space should show the list
key H D(#n) Y
Member function Acc.CbIndexOf
function# $name
;Finds combo box item and returns 0-based index.
;Returns -1 if not found.
;name - item text. Wildcard, case-insensitive.
STRINT si.s=name; si.i=-1
Acc ai.Find(this.a "LISTITEM" "" "" 0x10 0 0 "" &sub.Callback &si)
if(!ai.a) ret -1
ret si.i
#sub Callback
function# Acc&ai level STRINT&r
r.i+1
str s=ai.Name
if(!s.len and r.s.len) s=ai.Value ;;Chrome
ret !matchw(s r.s 1)
err ret 1