还有这个子程序
Declare Function GetTickco u* nt Lib \"kerne132\" () As Long
Sub timedelay(t As Long) \'Time delay sub.Unit=mSec Dim tt& tt = GetTickco u* nt() Do DoEvents Loop Until GetTickco u* nt() - tt >= t End Sub \'等待RS字符串返回 \'Comm是通信控件的名称 \'RS是欲等待的字符 \'DT是最长的等待时间 \'正常时返回值是所得的完整字符串,不正常时返回值是空字符串
Function waitrs(comm As MSComm, rs As String, dt As Long) As String Dim buf$, tt As Long buf = \"\" tt = GetTickco u* nt Do buf = buf & comm.Input Loop Until InStr(1, buf, rs) > 0 Or GetTickco u* nt - tt >= dt If InStr(1, buf, rs) > 0 Then waitrs = buf Else waitrs = \"\" End If End Function
编译的时候说找不到kerne132,不知道kerne132是什么东西
我在我的windows/system32目录下找到了kerne132.dll
谢谢高手 |