|
我试过了,代码如下,两种方法都可以.
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 ++)
{
ddt_set_row(table,table_Row);
# Login
set_window ("Login", 2);
edit_set ("Agent Name:", ddt_val(table,"Agent_Name"));
set_window ("Login", 6);
edit_set("Password:", ddt_val(table,"Password"));
edit_get_text("Agent Name:",name);
edit_get_text("Password:",pass);
if((name=="")||(pass==""))
{
tl_step("name or pass is none",1,"you can't put in");
}
}
ddt_close(table);
或者
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 ++)
{
ddt_set_row(table,table_Row);
# Login
set_window ("Login", 2);
edit_set ("Agent Name:", ddt_val(table,"Agent_Name"));
set_window ("Login", 6);
edit_set("Password:", ddt_val(table,"Password"));
edit_get_text("Agent Name:",name);
edit_get_text("Password:",pass);
if((name=="")||(pass==""))
tl_step("name or pass is none",1,"you can't put in");
}
ddt_close(table);
如果你加入括号的话,可以写一句else的语句,这样错误和没有错误的都会列出来了
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 ++)
{
ddt_set_row(table,table_Row);
# Login
set_window ("Login", 2);
edit_set ("Agent Name:", ddt_val(table,"Agent_Name"));
set_window ("Login", 6);
edit_set("Password:", ddt_val(table,"Password"));
edit_get_text("Agent Name:",name);
edit_get_text("Password:",pass);
if((name=="")||(pass==""))
{
tl_step("name or pass is none",1,"you can't put in");
}
else
{tl_step("name and pass is ok",0,"you can put in");}
}
ddt_close(table); |
|