module1.bas
来自「这是一个简单的串口通信程序,可以实现简单的发送和接受功能,源程序来自网络~」· BAS 代码 · 共 54 行
BAS
54 行
Attribute VB_Name = "Module1"
Option Explicit
Public xianshi As Boolean '是否显示发送信息,true显示,FALSE不显示
Public intPort As Integer '串行囗
Public strSet As String '协议
'Public intTime As Integer '发送时间间隔
'Public blnAutoSendFlag As Boolean '发送标志
'Public blnReceiveFlag As Boolean '接收标志
Public strEnd As String '结束字符
Public intReceiveLen As Integer
Public intOutMode As Integer
'启动
Public Sub Main()
'Dim delayTime As Double
'Dim counter As Double
Call Load(frmSplash)
Call frmSplash.Show
'Call Load(frmMain)
'delayTime = Timer()
'Do
' counter = Timer() - delayTime
' DoEvents
'Loop While (counter < 0.7)
'Call Unload(frmSplash)
'Call frmMain.Show
End Sub
' 获得指定目录下的所有文件的文件名列表
' Path 为目录的绝对路径, FileName() 为返回的文件名数组,fExp为返回的文件类型
Public Function GetFileList(ByVal Path As String, ByRef fileName() As String, Optional fExp As String) As Boolean
Dim fName As String, i As Long
If Right(Path, 1) <> "\" Then Path = Path & "\"
fName = Dir(Path & fExp)
i = 0
Do While fName <> ""
ReDim Preserve fileName(i) As String
fileName(i) = fName
fName = Dir
i = i + 1
'MsgBox fileName(i)
Loop
'MsgBox i
If i <> 0 Then
ReDim Preserve fileName(i - 1) As String
GetFileList = True
Else
GetFileList = False
End If
End Function
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?