zjviolet 发表于 2004-10-21 11:52:12

下拉框选年份,月份,我想让它做循环,每次可以改变年份,月份,要怎么做呢?

Sub Main
    Dim Result As Integer
   
    'Initially Recorded: 2004-10-2111:22:30
    'Script Name: newtouch1
   
   
    Window SetContext, "Caption=Newtouch ONE! - Microsoft Internet Explorer", ""
    Browser SetFrame,"Type=HTMLFrame;HTMLId=left;\;Type=HTMLFrame;HTMLId=forumList",""
    HTML Click, "Type=HTML;HTMLId=txt1_2_2", "Coords=38,2"
    Browser SetFrame,"Type=HTMLFrame;HTMLId=Main_frame",""
    Browser NewPage,"",""
    PushButton Click, "Type=PushButton;HTMLText=新增"
    Browser NewPage,"",""
    ComboBox Click, "Type=ComboBox;Name=chyear", ""
   
    ComboListBox Click, "Type=ComboListBox;Name=chyear", "text=2004"
    ComboBox Click, "Type=ComboBox;Name=chmonth", ""
    ComboListBox Click, "Type=ComboListBox;Name=chmonth", "Text=1"

End Sub

这是一部分代码,下拉框选年份,月份,我想让它做循环,每次可以改变年份,月份,要怎么做呢?

pcl2004_27 发表于 2004-10-21 15:44:52

Sub Main
    Dim Result As Integer
   
    'Initially Recorded: 2004-10-2111:22:30
    'Script Name: newtouch1
   ‘------------------------------------
   '添加代码
   '------------------------------------
   dim tm as string
   dim m asstring
   
   tm = '2003'
   m= '2'
   
   
    Window SetContext, "Caption=Newtouch ONE! - Microsoft Internet Explorer", ""
    Browser SetFrame,"Type=HTMLFrame;HTMLId=left;\;Type=HTMLFrame;HTMLId=forumList",""
    HTML Click, "Type=HTML;HTMLId=txt1_2_2", "Coords=38,2"
    Browser SetFrame,"Type=HTMLFrame;HTMLId=Main_frame",""
    Browser NewPage,"",""
    PushButton Click, "Type=PushButton;HTMLText=新增"
    Browser NewPage,"",""
    ComboBox Click, "Type=ComboBox;Name=chyear", ""
   
    ComboListBox Click, "Type=ComboListBox;Name=chyear", "text=" + tm
    ComboBox Click, "Type=ComboBox;Name=chmonth", ""
    ComboListBox Click, "Type=ComboListBox;Name=chmonth", "Text=" + m
End Sub

代码中我只是告诉你传递变量
你的变量用datapool代替处理,做成循环,就可以实现你的目的
做成循环 ,就可以
这里循环 留给你自己做,还有代码我的例子 有个问题 你直接用估计有问题
不过你自己稍微想一下 都可以解决的

zjviolet 发表于 2004-10-22 10:09:35

不用datapool可以吗?

不用datapool可以吗?

zjviolet 发表于 2004-10-22 11:06:12

谢谢

OK了。谢谢。
页: [1]
查看完整版本: 下拉框选年份,月份,我想让它做循环,每次可以改变年份,月份,要怎么做呢?