📄 module1.bas
字号:
Attribute VB_Name = "Module1"
Public strPort As String '端口号
Public strSetting As String '串口通信参数
Public strPassword As String '解锁密码
Public strCar As String '车牌前缀
Public strCEBFB As String '差额百分比
Public strGBTZ As String '过磅调整
Public strGBWDSJ As String '过磅稳定时间
Public SjZl As String '磅秤重量
Public isOK As Boolean '解锁成功
Public arrayFp() As String '选定发票数组
Public Sub InitGuoBangCs(ByVal Rt As ADODB.Recordset)
Rt.Filter = "FKey='GBXT-CKH'"
If Rt.EOF Then
strPort = "2"
Debug.Print "GBXT-CKH not found."
Else
strPort = NS(Rt!FValue)
End If
Rt.Filter = "FKey='GBXT-TXCS'"
If Rt.EOF Then
strSetting = "1200,N,7,1"
Debug.Print "GBXT-TXCS not found."
Else
strSetting = NS(Rt!FValue)
End If
Rt.Filter = "FKey='GBXT-JSMM'"
If Rt.EOF Then
Debug.Print "GBXT-JSMM not found."
Else
strPassword = NS(Rt!FValue)
End If
Rt.Filter = "FKey='GBXT-CPQZ'"
If Rt.EOF Then
Debug.Print "GBXT-CPQZ not found."
Else
strCar = NS(Rt!FValue)
End If
Rt.Filter = "FKey='GBXT-CEBFB'"
If Rt.EOF Then
strCEBFB = "0"
Debug.Print "GBXT-CEBFB not found."
Else
strCEBFB = NS(Rt!FValue)
End If
Rt.Filter = "FKey='GBXT-GBTZ'"
If Rt.EOF Then
strGBTZ = "0"
Debug.Print "GBXT-GBTZ not found."
Else
strGBTZ = NS(Rt!FValue)
End If
strGBTZ = CStr(Val(strGBTZ) / 1000)
Rt.Filter = "FKey='GBXT-GBWDSJ'"
If Rt.EOF Then
strGBWDSJ = "0"
Debug.Print "GBXT-GBWDSJ not found."
Else
strGBWDSJ = NS(Rt!FValue)
End If
End Sub
Public Function ND(sZ As Variant) As String
If Not IsNull(sZ) Then
ND = CStr(CDate(sZ))
Else
ND = ""
End If
End Function
Public Function NS(sZ As Variant) As String
On Error GoTo Errx
If Not IsNull(sZ) Then
NS = Trim(CStr(sZ))
Else
NS = ""
End If
Exit Function
Errx:
NS = ""
End Function
Public Function NI(sZ As Variant) As Currency
If Not IsNull(sZ) Then
NI = Trim(CCur(sZ))
Else
NI = 0
End If
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -