⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 module1.bas

📁 都是基于VB所做的程序集合,值得大家作为实践的参考资料.
💻 BAS
字号:
Attribute VB_Name = "Module1"
Option Explicit

Public Type XRange
   XStart As Single
   XEnd As Single
End Type

Public Function PathToName(ByVal strPath As String) As String
'========================================================
'自定义函数 , 将文件全路径名转化为文件名(无路径名, 无扩展名)
'========================================================
    Dim nLength As Integer      '字符串长度
    Dim i As Integer
    Dim strTemp As String
    Dim strTemp1 As String
    Dim nPosition As Integer
    
    nPosition = 999
    If InStr(strPath, ".") <> 0 Then
        strTemp = Left(strPath, Len(strPath) - 4)
    Else
        strTemp = strPath
    End If
    
    nLength = Len(strTemp)
    For i = Len(strPath) To 1 Step -1
        If Mid$(strTemp, i, 1) = "\" Then
            nPosition = i
            Exit For
        End If
    Next
    If nPosition = 999 Then
        PathToName = strTemp
    Else
        PathToName = Right(strTemp, nLength - nPosition)
    End If
End Function

Public Function BooleanToText(Optional ByVal TrueOrFalse As Boolean) As String
    If TrueOrFalse Then
        BooleanToText = "Y"
    Else
        BooleanToText = " "
    End If
End Function

Public Function TextToBoolean(Optional ByVal YOrN As String) As Boolean
    Select Case YOrN:
        Case "Y":
            TextToBoolean = True
        Case Else
            TextToBoolean = False
    End Select
End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -