找回密码
 加入
搜索
查看: 1353|回复: 2

[AU3基础] 【已解决】StringInStr 的判断问题请教,谢谢

[复制链接]
发表于 2017-5-28 14:06:59 | 显示全部楼层 |阅读模式
本帖最后由 pingfan5888 于 2017-5-28 20:39 编辑

ClipGet()的值匹配值,如:
完美人生||http://book.qidian.com/info/3516230
ClipGet()的值匹配值,如:
完美人生||http://book.qidian.com/info/3516230

                        $parray = StringInStr(GUICtrlRead(ClipGet()), '||')
                        
                        If $parray = 0 Then
                                Local $array = StringSplit(ClipGet(), '||', 1)
                                GUICtrlSetData($Input1, $array[2])
                                GUICtrlSetData($Input2, $array[1])
                        Else
                                MsgBox(48, "", "不匹配!" , 1)
                                
                        EndIf
$parray = 0 和,$parray = 1 时,都会出错,不会 MsgBox(48, "", "不匹配!" , 1) 这个,字符串匹配的几个函数( StringRegExp )都试了,实在不大明白,符合时,正常,不匹配时,错误信息不提示,程序直接弹出错误没了。。

请教各位大大,,谢谢。。
发表于 2017-5-28 15:59:06 | 显示全部楼层

If StringInStr(ClipGet(), '||') Then
        Local $array = StringSplit(ClipGet(), '||', 1)
        GUICtrlSetData($Input1, $array[2])
        GUICtrlSetData($Input2, $array[1])
Else
        MsgBox(48, "", "不匹配!" , 1)
EndIf
 楼主| 发表于 2017-5-28 20:38:49 | 显示全部楼层
回复 2# xzf680


    谢谢了,已解决了。。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-19 09:23 , Processed in 0.077213 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表