jinke 发表于 2005-7-26 13:52:28

why

Dim i As Integer
    for i=1 to 3 step 1
    Window SetContext, "Caption=PhotoBase", ""
    GenericObject DblClick, "Class=AfxFrameOrView;ClassIndex=1", "Coords=209+i*100,54"
   
    Window SetContext, "Caption=PhotoBase4 图像浏览器/编辑器", ""
    GenericObject Click, "Class=Afx:;ClassIndex=2", "Coords=997,21"
    next
为什么循环里的i*100没有执行 啊?????

ilovejolly 发表于 2005-7-26 14:31:00

加多个变量可以暂时解决
我刚才试了下,确实不执行的,不知道是不是格式错误。等高手来解答吧

jinke 发表于 2005-7-27 08:24:52

加多个变量可以暂时解决?
我试了还是不行啊,
s=i*100
Coords=209+s,54

ilovejolly 发表于 2005-7-27 09:20:07

你试试j=209+i*100

[ Last edited by ilovejolly on 2005-7-27 at 10:48 ]

jinke 发表于 2005-7-27 09:43:20

仍然不行啊

cdy90 发表于 2005-7-29 10:02:13

试试 "Coords=209+&cnum(i*100),54"

司空公子 发表于 2005-7-29 10:39:23

"Coords=209+i*100,54"是字符串的形式,所以你必须转化一下

Vitamin 发表于 2005-7-29 12:45:43

我改成这样了,你看看可以运行么?
Dim i As Integer
    for i=1 to 3 step 1
    dim j
    j=209+i*100
    Window SetContext, "Caption=PhotoBase", ""
    GenericObject DblClick, "Class=AfxFrameOrView;ClassIndex=1", "Coords="+j+",54"
   
    Window SetContext, "Caption=PhotoBase4 图像浏览器/编辑器", ""
    GenericObject Click, "Class=Afx:;ClassIndex=2", "Coords=997,21"
    next

ilovejolly 发表于 2005-7-29 14:41:16

试了半天试出来了,"Coords="+str(i)+",66"
是字符串连接来的,SQA好弱

[ Last edited by ilovejolly on 2005-7-29 at 14:46 ]

jinke 发表于 2005-7-29 14:54:51

谢谢大家啊

jinke 发表于 2005-7-29 15:07:39

我改成这样了,你看看可以运行么?
Dim i As Integer
    for i=1 to 3 step 1
    dim j
    j=209+i*100
    Window SetContext, "Caption=PhotoBase", ""
    GenericObject DblClick, "Class=AfxFrameOrView;ClassIndex=1", "Coords="+j+",54"
   
    Window SetContext, "Caption=PhotoBase4 图像浏览器/编辑器", ""
    GenericObject Click, "Class=Afx:;ClassIndex=2", "Coords=997,21"
    next
successful
试了半天试出来了,"Coords="+str(i)+",66"
是字符串连接来的,SQA好弱
also successful
页: [1]
查看完整版本: why