帮我看看循环哪里出错了,老跑到第9次就跑不下去了!
Option explicit
Dim intnumflyfrom,intnumflyto,intnumfrom
Dim strflyfrom,strflyto,strfrom
Dim i,j,cnt
Window("Flight Reservation").Restore
intnumflyfrom=Window("Flight Reservation").WinComboBox("Fly From:").GetItemsCount
intnumflyto=Window("Flight Reservation").WinComboBox("Fly To:").GetItemsCount
For i=0 to intnumflyfrom-1
For j=0 to intnumflyto-1
Window("Flight Reservation").Activate
Window("Flight Reservation").WinMenu("Menu").Select "File;New Order"
Window("Flight Reservation").ActiveX("MaskEdBox").Type "121212"
strflyfrom=Window("Flight Reservation").WinComboBox("Fly From:").GetItem(i)
Window("Flight Reservation").WinComboBox("Fly From:").Select strflyfrom
strflyto=Window("Flight Reservation").WinComboBox("Fly To:").GetItem(j)
Window("Flight Reservation").WinComboBox("Fly To:").Select strflyto
Window("Flight Reservation").WinButton("FLIGHT").Click
intnumfrom=Window("Flight Reservation").Dialog("Flights Table").WinList("From").GetItemsCount
cnt=randomnumber(0,intnumfrom-1)
strfrom=Window("Flight Reservation").Dialog("Flights Table").WinList("From").GetItem(cnt)
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select strfrom
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
reporter.ReportEvent micPass,"起始地"&strflyfrom,"目的地"&strflyto&"航次:"&strfrom
Window("Flight Reservation").WinEdit("Name:").Set "jack"
Window("Flight Reservation").WinEdit("Tickets:").Set "21"
Window("Flight Reservation").WinRadioButton("Business").Set
Window("Flight Reservation").WinButton("Insert Order").Click
Window("Flight Reservation").Dialog("Flight Reservations").WinButton("确定").Click
Window("Flight Reservation").WinEdit("Tickets:").Set "2"
Window("Flight Reservation").WinButton("Insert Order").Click
Next
Next