ASV
13 years agoContributor
Problem with Popupmenu
HI
I am tesing an application. When I click the mouseright button appears operations. I must check, if my wanted operation exists in them.
I write this code
1.Dim nstorage()
2.
3. wappl.Keys("[X93]")
4. menuCount = wMainForm.PopupMenu.Count
5. ReDim nStorage(menuCount)
6. For j = 0 To menuCount - 1
7. nStorage(j) = wMainForm.PopupMenu.Items(j).Caption
8. Next
9.
10.n = "my wanted name"
11.
12. If nStorage(j) = n then
13. Log.message("Operation with "&n&" name is exist")
14. Else
15. Log.Error("Operation with "&n&" name isn't exist")
16. End If
But when i run test and in lines 6-8 colecting the operations' name it passes over popupmenu twice and "menucount" is not equal the exact count of operations.
I am tesing an application. When I click the mouseright button appears operations. I must check, if my wanted operation exists in them.
I write this code
1.Dim nstorage()
2.
3. wappl.Keys("[X93]")
4. menuCount = wMainForm.PopupMenu.Count
5. ReDim nStorage(menuCount)
6. For j = 0 To menuCount - 1
7. nStorage(j) = wMainForm.PopupMenu.Items(j).Caption
8. Next
9.
10.n = "my wanted name"
11.
12. If nStorage(j) = n then
13. Log.message("Operation with "&n&" name is exist")
14. Else
15. Log.Error("Operation with "&n&" name isn't exist")
16. End If
But when i run test and in lines 6-8 colecting the operations' name it passes over popupmenu twice and "menucount" is not equal the exact count of operations.