|
4#
楼主 |
发表于 2005-3-25 17:58:37
|
只看该作者
table1 = "BuyInfo.xls";
table2 = "TEST.xls";
rc = ddt_open(table1, DDT_MODE_READWRITE);
rc1 = ddt_open(table2, DDT_MODE_READWRITE);
if (rc!= E_OK && rc != E_FILE_OPEN)
pause("Cannot open table1.");
if (rc1!= E_OK && rc1 != E_FILE_OPEN)
pause("Cannot open table2.");
ddt_get_row_count(table1,table1_RowCount);
for(table1_Row = 1; table1_Row <= table1_RowCount; table1_Row ++)
{
ddt_set_row(table1,table1_Row);
# Flight Reservation
set_window ("Flight Reservation", 1);
menu_select_item ("File;New Order");
obj_type ("MSMaskWndClass",ddt_val(table1,"Data"));
list_select_item ("Fly From:", ddt_val(table1,"Fly_From")); # Item Number 2;
list_select_item ("Fly To:", ddt_val(table1,"Fly_To")); # Item Number 1;
obj_mouse_click ("FLIGHT", 28, 45, LEFT);
# Flights Table
set_window ("Flights Table", 0);
button_press ("OK");
# Flight Reservation
set_window ("Flight Reservation", 2);
edit_set ("Name:", "Randy");
edit_set ("Tickets:", ddt_val(table1,"Tickets"));
button_press ("Insert Order");
obj_wait_info("Insert Done...","label","Insert Done...",10);
obj_get_text("Price:", Price); # $100.80
obj_get_text("Total:", Total); # $100.80
ddt_set_row(table2,table1_Row);
ddt_set_val(table2,"Price",Price);
ddt_set_val(table2,"Total",Total);
ddt_save(table2);
}
ddt_close(table1);
ddt_close(table2);
往TABLE2里面写数据的时候,最后总是只有一行...而且是最后的数据将前面的覆盖!
我想将每次得到的数据都写到table2里面。. |
|