以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  1月12日的重要更新 端口错误问题依然没有解决  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=145213)

--  作者:sloyy
--  发布时间:2020/1/12 17:32:00
--  1月12日的重要更新 端口错误问题依然没有解决
我在12月20日就提出新版本存在问题

现在新的版本又出来了,问题还是没有解决

图片点击可在新窗口打开查看此主题相关图片如下:搜狗截图20200112172656.png
图片点击可在新窗口打开查看





--  作者:有点蓝
--  发布时间:2020/1/12 21:26:00
--  
明天再反馈一下
--  作者:有点蓝
--  发布时间:2020/1/13 8:49:00
--  
换种方式判断

For Each sp As String In Ports.PortNames
    If sp <> "COM1" Then
        msgbox("COM1不存在")
        Return
    End If
Next

--  作者:sloyy
--  发布时间:2020/1/13 10:02:00
--  
好的,我先试试
--  作者:有点蓝
--  发布时间:2020/1/13 10:05:00
--  
3楼的判断方法有的问题,这样判断
Dim hascom1 As Boolean
For Each sp As String In Ports.PortNames
    If sp = "COM1" Then
        hascom1 = True
        Exit For
    End If
Next
If not hascom1 Then
    msgbox("COM1不存在")
    Return
End If