📄 sicl32.bas
字号:
Dim id As Integer
Dim thisErrno As Integer
Dim myerrstr As String * 60
Dim tmp As Integer
tmp = VarType(buf)
' Call the function in the SICL DLL and check for errors
id = vb_iwrite(1, id1, buf, datalen, endi, actual)
iwrite = id
If id <> 0 Then
thisErrno = vb_igeterrno()
If thisErrno <> 0 Then
Err.Clear ' set default values in the error object
' set the error string and raise the error
tmp = vb_igeterrstr(thisErrno, myerrstr)
Err.Description = myerrstr
Err.Raise (thisErrno) 'Raise the error
End If
End If
End Function
Function ifwrite(ByVal id1 As Integer, ByVal buf As Variant, ByVal datalen As Long, ByVal endi As Integer, actual As Long) As Integer
Dim id As Integer
Dim thisErrno As Integer
Dim myerrstr As String * 60
Dim tmp As Integer
tmp = VarType(buf)
' Call the function in the SICL DLL and check for errors
id = vb_iwrite(2, id1, buf, datalen, endi, actual)
ifwrite = id
If id <> 0 Then
thisErrno = vb_igeterrno()
If thisErrno <> 0 Then
Err.Clear ' set default values in the error object
' set the error string and raise the error
tmp = vb_igeterrstr(thisErrno, myerrstr)
Err.Description = myerrstr
Err.Raise (thisErrno) 'Raise the error
End If
End If
End Function
Function iread(ByVal id1 As Integer, ByRef buf As Variant, ByVal bufsize As Long, reason As Integer, actual As Long) As Integer
Dim id As Integer
Dim thisErrno As Integer
Dim myerrstr As String * 60
Dim tmp As Integer
tmp = VarType(buf)
' Call the function in the SICL DLL and check for errors
id = vb_iread(1, id1, buf, bufsize, reason, actual)
iread = id
If id <> 0 Then
thisErrno = vb_igeterrno()
If thisErrno <> 0 Then
Err.Clear ' set default values in the error object
' set the error string and raise the error
tmp = vb_igeterrstr(thisErrno, myerrstr)
Err.Description = myerrstr
Err.Raise (thisErrno) 'Raise the error
End If
End If
End Function
Function ifread(ByVal id1 As Integer, ByRef buf As Variant, ByVal bufsize As Long, reason As Integer, actual As Long) As Integer
Dim id As Integer
Dim thisErrno As Integer
Dim myerrstr As String * 60
Dim tmp As Integer
tmp = VarType(buf)
' Call the function in the SICL DLL and check for errors
id = vb_iread(2, id1, buf, bufsize, reason, actual)
ifread = id
If id <> 0 Then
thisErrno = vb_igeterrno()
If thisErrno <> 0 Then
Err.Clear ' set default values in the error object
' set the error string and raise the error
tmp = vb_igeterrstr(thisErrno, myerrstr)
Err.Description = myerrstr
Err.Raise (thisErrno) 'Raise the error
End If
End If
End Function
Function itermchr(ByVal id1 As Integer, ByVal tchr As Integer) As Integer
Dim id As Integer
Dim thisErrno As Integer
Dim myerrstr As String * 60
Dim tmp As Integer
' Call the function in the SICL DLL and check for errors
id = vb_itermchr(id1, tchr)
itermchr = id
If id <> 0 Then
thisErrno = vb_igeterrno()
If thisErrno <> 0 Then
Err.Clear ' set default values in the error object
' set the error string and raise the error
tmp = vb_igeterrstr(thisErrno, myerrstr)
Err.Description = myerrstr
Err.Raise (thisErrno) 'Raise the error
End If
End If
End Function
Function igettermchr(ByVal id1 As Integer, tchr As Integer) As Integer
Dim id As Integer
Dim thisErrno As Integer
Dim myerrstr As String * 60
Dim tmp As Integer
' Call the function in the SICL DLL and check for errors
id = vb_igettermchr(id1, tchr)
igettermchr = id
If id <> 0 Then
thisErrno = vb_igeterrno()
If thisErrno <> 0 Then
Err.Clear ' set default values in the error object
' set the error string and raise the error
tmp = vb_igeterrstr(thisErrno, myerrstr)
Err.Description = myerrstr
Err.Raise (thisErrno) 'Raise the error
End If
End If
End Function
Function ivprintf(ByVal id1 As Integer, ByVal fmt As String, Optional ByVal ap As Variant) As Integer
Dim id As Integer
Dim thisErrno As Integer
Dim myerrstr As String * 60
Dim tmp As Integer
Dim howLong As Long
' Force no error to be condition
Call vb_icauseerr(id1, 0, 0)
If VarType(ap) = 8 Then
howLong = Len(ap)
Else
howLong = 0
End If
' Call the function in the SICL DLL and check for errors
If IsMissing(ap) Then
id = vb_ivprintf(ByVal id1, ByVal fmt, ByVal sEmpty, ByVal howLong)
ElseIf IsEmpty(ap) Then
id = vb_ivprintf(ByVal id1, ByVal fmt, ByVal sEmpty, ByVal howLong)
Else
id = vb_ivprintf(ByVal id1, ByVal fmt, ByVal ap, ByVal howLong)
End If
ivprintf = id
thisErrno = vb_igeterrno()
If thisErrno <> 0 Then
Err.Clear ' set default values in the error object
' set the error string and raise the error
tmp = vb_igeterrstr(thisErrno, myerrstr)
Err.Description = myerrstr
Err.Raise (thisErrno) 'Raise the error
End If
End Function
Function ivscanf(ByVal id1 As Integer, ByVal fmt As String, ByRef myVal As Variant) As Integer
Dim id As Integer
Dim thisErrno As Integer
Dim howLong As Long
Dim myerrstr As String * 60
Dim tmp As Integer
Dim returnStr As String
' Put anything in the local string to make non-null
returnStr = "aa"
' Force no error to be condition
Call vb_icauseerr(id1, 0, 0)
tmp = VarType(myVal)
If VarType(myVal) = 8 Then
howLong = Len(myVal)
Else
howLong = 0
End If
' Call the function in the SICL DLL and check for errors
If tmp = 8 Then
id = vb_ivscanf(id1, fmt, returnStr, howLong)
'Place scanf value into myVal
myVal = returnStr
Else
id = vb_ivscanf(id1, fmt, myVal, howLong)
End If
ivscanf = id
thisErrno = vb_igeterrno()
If thisErrno <> 0 Then
myerrstr = ""
Err.Clear ' set default values in the error object
' set the error string and raise the error
tmp = vb_igeterrstr(thisErrno, myerrstr)
Err.Description = myerrstr
MsgBox myerrstr
Err.Raise (thisErrno) 'Raise the error
End If
End Function
Function iflush(ByVal id1 As Integer, ByVal mask As Integer) As Integer
Dim id As Integer
Dim thisErrno As Integer
Dim myerrstr As String * 60
Dim tmp As Integer
' Call the function in the SICL DLL and check for errors
id = vb_iflush(id1, mask)
iflush = id
If id <> 0 Then
thisErrno = vb_igeterrno()
If thisErrno <> 0 Then
Err.Clear ' set default values in the error object
' set the error string and raise the error
tmp = vb_igeterrstr(thisErrno, myerrstr)
Err.Description = myerrstr
Err.Raise (thisErrno) 'Raise the error
End If
End If
End Function
Function isetbuf(ByVal id1 As Integer, ByVal mask As Integer, ByVal size As Integer) As Integer
Dim id As Integer
Dim thisErrno As Integer
Dim myerrstr As String * 60
Dim tmp As Integer
' Call the function in the SICL DLL and check for errors
id = vb_isetbuf(id1, mask, size)
isetbuf = id
If id <> 0 Then
thisErrno = vb_igeterrno()
If thisErrno <> 0 Then
Err.Clear ' set default values in the error object
' set the error string and raise the error
tmp = vb_igeterrstr(thisErrno, myerrstr)
Err.Description = myerrstr
Err.Raise (thisErrno) 'Raise the error
End If
End If
End Function
Function iclear(ByVal id1 As Integer) As Integer
Dim id As Integer
Dim thisErrno As Integer
Dim myerrstr As String * 60
Dim tmp As Integer
' Call the function in the SICL DLL and check for errors
id = vb_iclear(id1)
iclear = id
If id <> 0 Then
thisErrno = vb_igeterrno()
If thisErrno <> 0 Then
Err.Clear ' set default values in the error object
' set the error string and raise the error
tmp = vb_igeterrstr(thisErrno, myerrstr)
Err.Description = myerrstr
Err.Raise (thisErrno) 'Raise the error
End If
End If
End Function
Function ilocal(ByVal id1 As Integer) As Integer
Dim id As Integer
Dim thisErrno As Integer
Dim myerrstr As String * 60
Dim tmp As Integer
' Call the function in the SICL DLL and check for errors
id = vb_ilocal(id1)
ilocal = id
If id <> 0 Then
thisErrno = vb_igeterrno()
If thisErrno <> 0 Then
Err.Clear ' set default values in the error object
' set the error string and raise the error
tmp = vb_igeterrstr(thisErrno, myerrstr)
Err.Description = myerrstr
Err.Raise (thisErrno) 'Raise the error
End If
End If
End Function
Function iremote(ByVal id1 As Integer) As Integer
Dim id As Integer
Dim thisErrno As Integer
Dim myerrstr As String * 60
Dim tmp As Integer
' Call the function in the SICL DLL and check for errors
id = vb_iremote(id1)
iremote = id
If id <> 0 Then
thisErrno = vb_igeterrno()
If thisErrno <> 0 Then
Err.Clear ' set default values in the error object
' set the error string and raise the error
tmp = vb_igeterrstr(thisErrno, myerrstr)
Err.Description = myerrstr
Err.Raise (thisErrno) 'Raise the error
End If
End If
End Function
Function ireadstb(ByVal id1 As Integer, ByRef stb As Integer) As Integer
Dim id As Integer
Dim thisErrno As Integer
Dim myerrstr As String * 60
Dim tmp As Integer
' Call the function in the SICL DLL and check for errors
id = vb_ireadstb(id1, stb)
ireadstb = id
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -