|
楼主的问题解决了吗?我的问题解决了。还的感谢楼上的兄弟。我自己写了个函数
#Example:
# SetDateOnCalendar("11/16/2005","09/17/2006");
public function SetDateOnCalendar(in StrCurrentDate,in StrSetDate//StrCurrentDate就是当前时间,StrSetDate就是你设置的时间
{ auto StrCDYear;
auto StrSDYear;
auto StrCDMonth;
auto StrSDMonth;
auto StrSDDay;
auto i;
auto m;
auto n;
auto Table_Row;
auto Table_Col;
auto Text;
auto a[];
auto k;
auto not_found;
k=0;
a[k]=0;
not_found=0;
StrCDYear=substr(StrCurrentDate,7,4);
StrSDYear=substr(StrSetDate,7,4);
StrCDMonth=substr(StrCurrentDate,1,2);
StrSDMonth=substr(StrSetDate,1,2);
if (substr(StrSetDate,4,1)=="0")
StrSDDay=substr(StrSetDate,5,1);
else
StrSDDay=substr(StrSetDate,4,2);
set_window("Calendar",6);
web_set_event("html_table","click",HANDLER,ENABLE);
# change date page
if (StrCDYear>StrSDYear)//翻页
{
for(i=1;i<=(StrCDYear-StrSDYear)*12+(StrCDMonth-StrSDMonth);i++)
web_image_click("left", 3, 2);
}
## change date page //翻页
if(compare_text(StrCDYear,StrSDYear)&&(StrCDMonth>StrSDMonth))
{
for(i=1;i<=(StrCDMonth-StrSDMonth);i++)
web_image_click("left", 3, 2);
}
# change date page
if(compare_text(StrCDYear,StrSDYear) &&(StrCDMonth<StrSDMonth)) //翻页
{
for(i=1;i<=(StrSDMonth-StrCDMonth);i++)
web_image_click("right", 4,3);
}
# change date page
if (StrCDYear<StrSDYear)//翻页
{
for(i=1;i<=(StrSDYear-StrCDYear)*12+(StrSDMonth-StrCDMonth);i++)
web_image_click("right", 4,3);
}
tbl_get_rows_count("DateSelet",Table_Row);
tbl_get_cols_count("DateSelet",Table_Col);
for(m=5;m<=Table_Row;m++)//找你设置的天
{
for(n=1;n<=Table_Col;n++)
{
tbl_get_cell_data("DateSelet",m,n,Text);
a[k]=Text;
k++;
}
}
for(k=0;k<=(Table_Row-5)*Table_Col-1;k++)
{
not_found=0;
if(compare_text(a[k],StrSDDay))
{
web_event("{class: object,MSW_class: html_general_element,html_name: "&a[k]&"}", "click");
break;
}
}
} |
|