|
2#
楼主 |
发表于 2006-6-15 15:42:24
|
只看该作者
# µ¥Î»×é
# δÍê³É.........................»ñµÃϵͳÐÅÏ¢´íÎó.!!!!!!!!
# June 08 2006
# ÎҵŤ×÷
win_activate ("ÎҵŤ×÷");
set_window ("ÎҵŤ×÷", 1);
tbl_activate_cell ("mywork.dw_1", "#8", "ShowName");
# µ¥Î»×é
static UnitTypeNum[ ] = {4, 6, 4, 6};
begin=1;
end = 0;
# Íâ²ãÑ»· µ¥Î»×éµÄ´óÀà.
table = "power_unit_type.xls";
rc = ddt_open(table, DDT_MODE_READ);
if (rc!= E_OK && rc != E_FILE_OPEN)
pause("Cannot open table.");
ddt_get_row_count(table,table_RowCount);
for(table_Row = 1; table_Row <= table_RowCount; table_Row ++)
{
if (rc!= E_OK && rc != E_FILE_OPEN)
pause("Cannot open table.");
TypeID = ddt_val_by_row(table, table_Row, "TypeID");
TypeName = ddt_val_by_row(table, table_Row, "TypeName");
ddt_set_row(table,table_Row);
set_window ("µ¥Î»×é", 1);
obj_mouse_click ("uo_new", 39, 40, LEFT);
obj_mouse_click ("uo_new", 39, 40, LEFT);
# ±à¼
set_window ("±à¼", 1);
edit_get_text("dw_1.code",text);
len = length(text);
if (len <= 0)
{
edit_set_insert_pos ("dw_1.code", 0, 0);
obj_type ("dw_1.code",TypeID);
}
tbl_set_selected_cell ("dw_1", "#1", "name");
obj_type ("dw_1.name",TypeName);
tbl_set_selected_cell ("dw_1", "#1", "shortcut");
# ÄÚ²ãÑ»·
tableUnit = "power_unit.xls";
rcUnit = ddt_open(tableUnit, DDT_MODE_READ);
if (rcUnit= E_OK && rcUnit != E_FILE_OPEN)
pause("Cannot open table.");
ddt_get_row_count(tableUnit,table_RowCountUnit);
end = UnitTypeNum[table_Row-1];
end += begin;
end -= 1;
for(begin; begin <= end; begin ++)
{
obj_mouse_click ("uo_new", 17, 30, LEFT);
obj_mouse_click ("uo_new", 17, 30, LEFT);
Unit = ddt_val_by_row(tableUnit, begin, "UnitName");
tbl_set_selected_cell ("dw_detail", "#"&begin, "IDAsInfo2");
tbl_set_cell_data ("dw_detail", "#"&begin, "IDAsInfo2", Unit);
} # ÄÚ²ã½áÊø
ddt_close(rcUnit);
# ±à¼
obj_mouse_click ("uo_save", 21, 28, LEFT);
obj_mouse_click ("uo_save", 21, 28, LEFT);
# ϵͳÌáʾ
set_window ("ϵͳÌáʾ", 2);
button_press ("È·¶¨");
win_close("±à¼");
} # Íâ²ã½áÊø
ddt_close(table);
set_window ("µ¥Î»×é", 1);
list_select_item ("tv_1", "µ¥Î»×é"); # Item Number 0;
obj_mouse_click ("uo_refresh", 8, 35, LEFT);
obj_mouse_click ("uo_refresh", 8, 35, LEFT);
obj_mouse_click ("uo_exit", 24, 32, LEFT);
obj_mouse_click ("uo_exit", 24, 32, LEFT);
这不叫测试,这叫输入数据. 刚学. |
|