字符串连接问题

啦啦啦_126576 2020-3-31 1230

请问以下代码怎么修改才正确,谢谢!


Function FindPNG(png)

        dim xy_png = ""

        dim pngPath = ""

        pngPath = "@res:"&png &".png"

        #icon(pngPath)

        xy_png = Image.Find({"wnd":[{"cls":"LDPlayerMainFrame","title":"abc","app":"dnplayer"}]},{"height":0,"width":0,"x":0,"y":0},@res pngPath,0.9,10000,{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200,"sCursorPosition":"Center","bSetForeground":true})

        TracePrint(xy_png)

End Function


FindPNG("png001")

最新回复 (6)
  • 啦啦啦_126576 2020-3-31
    2
    太简单了没有人愿意回答吗,呜呜~~~~
  • life 2020-3-31
    3

    @res前面去掉

  • 啦啦啦_126576 2020-4-1
    4

            pngPath = png &".png"
            #icon("@res:"& pngPath)

    应该是基本语法问题
    去掉 @ 不行,改成上面那样还是不行,老师能直接给代码吗?我小白一枚,语法还不懂,又找不到相关的教程。

  • life 2020-4-1
    5
    @res"xx"&变量&"Xx.后缀名"
  • 啦啦啦_126576 2020-4-1
    6
    Function FindPNG(png)
       dim pngPath = ""
    pngPath = "D:\\LUA\\共享\\Uibot\\" &png &".png"
       #icon(@res":"& pngPath)  //?????
       //找图代码.......
    End Function

    FindPNG("p0001_heshen")


    [23:43:21]uibot3854be5b39964c.task 第6行:第14个字符:应该出现以下内容 '{CONST_TRUE, CONST_FALSE, CONST_NULL, STRING, LONG_STRING, FLOAT, HEX_INT, DEC_INT}'

    [23:43:21]uibot3854be5b39964c.task 第6行:第30个字符:出现非预期的内容 ')'

  • life 2020-4-2
    7
    语法格式基本都是错的。看完基础教程再写。
返回
发新帖