So my hope is that I can loop through two separate lists at the same time and verify matching data. Right now this set-up (Thanks Joe Glines!)
This code will loop through the numbers in Var one by one and display the variable vStatus in the msgbox.
Code: Select all
#Persistent
var=
(
1
2
3
4
5
)
var2=
(
a
b
c
d
e
)
F1::
Loop, parse, Var, `n, `r ;loop over Var line by line
{
IfEqual, A_LoopField,,continue ;Skip loop if blank
;IfEqual, A_index,5,break ;Break if index =value
;~ MsgBox,,Loop index and values, % A_index a_tab A_LoopField
pwb := WBGet() ;included in loop just in case gets dissconnected
URL:="https://www.genericwebsite.com/generic.x?appId=" . A_LoopField ; concatenate url and current row
;***********Navigate to value*******************
pwb.Navigate(URL) ;Navigate to URL
while pwb.busy or pwb.ReadyState != 4 ;Wait for page to load
Sleep, 100
;***********Grab a data point*******************
Status:=pwb.document.GetElementsByTagName("Span")[3].InnerText ;Get Tagname and Array value
MsgBox STATUS: %Status%
}
return
;************Pointer to Open IE Window******************
WBGet(WinTitle="ahk_class IEFrame", Svr#=1) { ;// based on ComObjQuery docs
static msg := DllCall("RegisterWindowMessage", "str", "WM_HTML_GETOBJECT")
, IID := "{0002DF05-0000-0000-C000-000000000046}" ;// IID_IWebBrowserApp
;// , IID := "{332C4427-26CB-11D0-B483-00C04FD90119}" ;// IID_IHTMLWindow2
SendMessage msg, 0, 0, Internet Explorer_Server%Svr#%, %WinTitle%
if (ErrorLevel != "FAIL") {
lResult:=ErrorLevel, VarSetCapacity(GUID,16,0)
if DllCall("ole32\CLSIDFromString", "wstr","{332C4425-26CB-11D0-B483-00C04FD90119}", "ptr",&GUID) >= 0 {
DllCall("oleacc\ObjectFromLresult", "ptr",lResult, "ptr",&GUID, "ptr",0, "ptr*",pdoc)
return ComObj(9,ComObjQuery(pdoc,IID,IID),1), ObjRelease(pdoc)
}
}
}
return
Code: Select all
IfInString, A_LoopField, %Status%
{
MSgbox Match!
}
Elses
Msgbox No Match!