06-11-2008, 10:45 PM
I wrote a loop to to put the values in "all items" in the WinListView object above into an array and then loop through and compare to a parameter in the datatable. The loop works correctly for the value in the first row but then next time it loops through i get: Subscript out of range: 'p'
Can anyone help me with this? Here is my code-
Can anyone help me with this? Here is my code-
Code:
Get number of Rows (for Loop) and Info
TECH_ROWS = window("Workforce Management").Window("R&D").WinListView("Techs").GetROProperty ("items count")
TECH_ITEMS = window("Workforce Management").Window("R&D").WinListView("Techs").GetROProperty ("all items")
'Split Tech Info in to an Array
TECH_SPLIT = split(TECH_ITEMS, "All ")
TECH_INFO = split(TECH_SPLIT(0), "None Selected")
'Loop a MSGBOX for every Array value
For p = 0 to TECH_ROWS -1
msgbox "Tech Found on Row " & p +1 & " is: " & Trim(TECH_INFO(p))
'Job matching from Datasheet and values in Array
If TechID = Trim(TECH_INFO(p)) Then
msgbox "Tech = " & TechID & vbCr & "Row Found on Screen = " & Trim(TECH_INFO(p))
End If
Next